unsigned long int l = 0;
unsigned long int b = 1+ (x / 2);
if(x == 1)
unsigned long int m = l + (b-l) / 2;
if(m *m == x)
- 1 person likes this.
- Nagendra Kumar started the forum topic find the largest subset of it which form a sequence in the group Google Interview
Given an int array which might contain duplicates, find the largest subset of it which form a sequence.
then ans is 4,5,6,7
Sorting is an obvious solution. Can this be done in O(n) time