junk.programmer
BAN USER- 0of 0 votes
Answerswe have streaming numbers, where numbers may repeat for example 1,2,5,11,2,8,2,9 number 2 is repeating. provide nth number where n is the index of number, excluding the repeated number. hence for above example if n is 3 return 8 because 2 is repeating so excluded. best time and space. code in java.
- junk.programmer in India| Report Duplicate | Flag | PURGE
Amazon - 0of 0 votes
Answersgiven m x n matrix print all the possible paths top to down.
- junk.programmer in United States
Example
1 2 3
4 5 6
7 8 9
path for root(0,0) 1
1-4-7
1-4-8
1-5-7
1-5-8
1-5-9
similarly path for 2(0,1)
2-4-7
2-4-8
2-5-7
2-5-8
2-5-9
2-6-8
2-6-9
note- root 1 can go to middle down or right down since there is no left index available. if root element has left middle and right it can go to all those paths like 2 or 5.
follow up : provide the path which has maximum path sum.
code in java.| Report Duplicate | Flag | PURGE
Yahoo Computer Scientist Matrix
how will u solve using linked Hashmap?
- junk.programmer November 05, 2012because index 0 is 1, index 1 is 5 since 2 is repeated value that's why not considered index 2 is 11 and index 3 is 8
- junk.programmer November 05, 2012also provide the efficiency of algo.
- junk.programmer October 17, 2012
RepYorgaKeaton, Area Sales Manager at AMD
Hi, I am Yorga , Information record clerk perform clerical duties that include filing and organising records and collecting information. My ...
need better implementation this in o(n) space and o(n) time.
- junk.programmer November 05, 2012