Oracle Application Software Developer
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-05-19Added By Anonymous
Source: Link
Company: Oracle
Role: Application Software Developer
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Given an unsorted array we have to find the longest consecutive.
Note: Should not sort or use any datastructure which sort the array. The array also contains duplicates so you should count one time even its duplicate value is present.
example {100, 98, -1, 0, 99, 1, 3, 4, 2, 5, 67}
In this -1, 0, 1, 2, 3, 4, 5 which is the longest consecutive. The count is 7, output is 7.