fire and ice
BAN USERwe can constrain the number ending digits of year to:
21,11,01,90,80,70,60,50,40,30,20,10 so this will give a valid month in palindrome string, similarly we can constrain the starting 2digits in yyyy so that we'll get a valid date...
we can use randomized_select algorithm for finding the top 3 max values (they wud b in the indices n-1,n-2,n-3 respectively) and then we can easily do the rest of the manipulations. so running time here wud b O(n).
- fire and ice August 19, 2012yeah i think this will do, but u ll have to sort the othr array which u ll be using for lookups....
- fire and ice August 14, 2012@dashdash is there any other solution to the problem except hashtables?
- fire and ice August 14, 2012suggest any better solution...
- fire and ice August 12, 2012Find the max no of games played from the data, fix the rank metrics as rank_helper=(games played*wins/max games) or something similar to this and then sort the metrics and assign rank to the corresponding player accordingly.... By this the time complexity will be O(nlogn).
- fire and ice August 12, 2012even i got same question in written exam of some company i forgot... this question is very ambiguous...
- fire and ice August 09, 2012nicely answered... hey bt can u plz elaborate on what does it mean by "in one pass"...
- fire and ice August 08, 2012hey what does one pass here means? does it mean that we can't use recursion?
- fire and ice August 08, 2012@devsri: wat do u mean by working code? has adobe asked u to code actually?
- fire and ice August 02, 2012@yoda: i think ur approach is wrong, what u r checking is sum of 2 elements while as per the question it can be a sub-array... this problem is same as subarray sum problem which can be done by recursion and DP...
- fire and ice July 30, 2012this can be done by DP, try using LIS[i]=1+max{LIS[1.....i-1]}... i hv nt included the base cases here...
- fire and ice July 29, 2012no way for this...
- fire and ice July 24, 2012cud u be more specific? what if every level has leafs?
- fire and ice July 18, 2012using quick sort will be fine??? because as far as i know recursive algorithms are also considered as using extra space in the form of stack...
- fire and ice July 18, 2012hey guys, can anyone of you kindly help me out with the sorting algo which u are using for O(1) space complexity and O(nlgn) time complexity?
- fire and ice July 18, 2012
hey can u elaborate a bit on ur bubblesort method?
- fire and ice August 19, 2012