ADP Interview Question
Software Engineer in TestsCountry: United States
Interview Type: Phone Interview
Clarification - my friend also came up with an O(N^2) solution and the interviewer does not seem to have asked for a linear solution.. however out of my curiosity, I'm asking you folks to tell me if there is a way to do this in O(N)?
This is the one I have come up with... it's of the order N^2. But coming to space, although I have used an additional list, it's not as big as the input array... Please let me know if we can do this in O(N) and without using extra space (list, array or any other variables)?
}
- Jeanclaude February 07, 2014