HackerEarth: Adobe Hiring challenge problem Mind Palaces
http://www.hackerearth.com/adobe-hiring-challenge/algorithm/mind-palaces-3/
If input number is -1, print Kth Largest of the input numbers else keep calculating. Exit on -2
O(lg n) solution for finding the transition points 0 to 1 and 1 to 2 in an infinite array of sorted numbers 0, 1 and 2.
To find the maximum of the sum of nodes of any of the paths from root to leaves in a binary tree.
Complexity: O(no. of nodes)