N/A Interview Question for Software Engineer / Developers
- 0of 0 votes
Given a set of entries, each containing a time index and a int count value,- FrickenHamster September 26, 2014 in United States
write a function that will give the time interval with the highest count together,
if we had entries
and we ran something like
int highestInterval(int interval_range)
highestInterval( 50 )
it would return 100, because in 100-150, you have counts 2, 1, and 10.
I managed to get a O(n^2) solution for it, but I think theres a better solution. I think it might have to do with some preprocessing of the interval buckets, but I can't figure out the solution.
| Report Duplicate | Flag | PURGE
N/A Software Engineer / Developer Algorithm
Open Chat in New Window