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.
Thanks for the explanation. For the later part of this solution, one can use a binary tree to perform the comparison. Let the size of the set containing the pruned numbers on the above with leading 0 be M (the numbers at and above the line A), with leading 1 be K, rather then O(M*K) comparison, binary tree provides a complexity O(M+K).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Yet Another Minimax Problem
You are viewing a single comment's thread. Return to all comments →
Thanks for the explanation. For the later part of this solution, one can use a binary tree to perform the comparison. Let the size of the set containing the pruned numbers on the above with leading 0 be M (the numbers at and above the line A), with leading 1 be K, rather then O(M*K) comparison, binary tree provides a complexity O(M+K).