Ok, i can’t sort the given array, can’t create auxiliary array. What am I supposed to do ??
you can use binary search on solution’s all possible values or raise a seek help request for full approach
Paras Meena But binary search is for sorted array. And I can’t tamper with the given array. Was reading an algorithm (medians of medians) but that too uses extra space.
You can use Collections.sort() method in java…that makes this a 2 line code.
You can’t, the Vector is"Final" i.e. “READ ONLY” so you can’t sort/ modify it.