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.
This is a good hint. It is essentially what I did, and although it was slow, it didn't time out. This can be improved, however, to O(log n), using binary search through the square numbers. So you can get log time without actually calculating any square roots.
Sherlock and Squares
You are viewing a single comment's thread. Return to all comments →
This is a good hint. It is essentially what I did, and although it was slow, it didn't time out. This can be improved, however, to O(log n), using binary search through the square numbers. So you can get log time without actually calculating any square roots.