FrickenHamster
BAN USER
- 2of 2 votes
AnswersGiven a set of entries, each containing a time index and a int count value,
- FrickenHamster in United States
ie
class Entry
{
time:int
count:int
}
write a function that will give the time interval with the highest count together,
ie,
if we had entries
100, 2
100, 1
110, 10
200, 4
1000, 3
1200, 8
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 - 1of 1 vote
AnswersMove the first n numbers in a 10 element array to the end.
- FrickenHamster in United States for Lync
I think the way to do it was to reverse the array and then reverse the first 10-n and then the last n.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Arrays
Repcamillerharry, Data Engineer at Student
Hi, I am Camille from Easton USA. Currently, I am working as Staff assistant at Northern Star company. A managed ...
Repsallieroliphant, Project Leader at Wissen Technology
With years of experience I can guarantee you that our licensed company specializes in furnace maintenance scarborough, air conditioners and ...
Replarryehickl, Associate at ABC TECH SUPPORT
I am a blogger in the Geek system operator . As an editor with a strong background in english and hindi ...
RepHi, I am Anne from Portsmouth, USA. I have been working as a freelance digital illustrator specialized in 3D character ...
ahh, thank you. I should've thought about using a head and a tail.
- FrickenHamster September 26, 2014