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.
Yes i know the bitcount function is O(1) within the problem constraints. If we study the problem with pure mathematical point of view you will see that bitCount function is a O(n) function where n is the number of bits in the data_type on which the bitCount funciton is called.
bitCount(longn)//it is O(1)bitCount(arbitrary_data_type)//it is O(N) where n is num_bits
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
Yes i know the bitcount function is O(1) within the problem constraints. If we study the problem with pure mathematical point of view you will see that bitCount function is a O(n) function where n is the number of bits in the data_type on which the bitCount funciton is called.