We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sorry, maybe I don't understand your solution... You must check all possible numbers in interval [0...maxAi] for 'median'. You can not check only elements from array. Example :
2 1 1
4 2
Array is:
3 3
Answer 1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Array
You are viewing a single comment's thread. Return to all comments →
Sorry, maybe I don't understand your solution... You must check all possible numbers in interval [0...maxAi] for 'median'. You can not check only elements from array. Example :
2 1 1
4 2
Array is: 3 3
Answer 1