career.baghel
BAN USER- 1of 1 vote
Answersthere was a party.there was a log register in which entry and exit time of all the guests was logged.you have to tell the time at which there was maximum guest in the party.
- career.baghel
input will be the entry and exit time of all the n guests [1,4] [2,5] [9,12] [5,9] [5,12]
the output will be t=5 as there was maximum 3 guest were there namly guest(starting from 1) 2,4 and 5.| Report Duplicate | Flag | PURGE
Google Developer Program Engineer
is any solution exist in given constraints? or shall i call Petr Mitrichev :P
- career.baghel September 11, 2010it was not 1-24 range of numbers. tht would be so easy.say the time limit is 10000..
there is some DP approach of O(n) tht dont require extra space but i was not able to recall tht at that time :(
i am looking for that one
what you actually wanna do with stack. we want to get rid of extra brackets right?
- career.baghel September 01, 2010so what exactly do we need to do here.are we change 1 digit in a number and check if that is a prime number and built the graph accordingly and then proceed with BFS as he said?
- career.baghel September 01, 2010
@cool indeed i have seen the same problem on z-training too thats why i am saying that there is some DP solution exist for this problem.well anyways nlogn solution seems gud enof and i actually gave that solution in the interview.lets see if the google guy knows the O(n) solution ^^
- career.baghel September 12, 2010