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 detailed explaination, rospvar. I was able to implement this in Java and get test case 5 to pass in addition to 0 and 1 but cases 2, 3, and 4 still fail for me. The method below is the implementation which is given a score of 7.5. What I don't understand is why I get the correct answers for the other tests in my IDE but they won't pass on HackerRank. If there is a max time then, why doesn't HackerRank identify that as a requirement?
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
Thanks for the detailed explaination, rospvar. I was able to implement this in Java and get test case 5 to pass in addition to 0 and 1 but cases 2, 3, and 4 still fail for me. The method below is the implementation which is given a score of 7.5. What I don't understand is why I get the correct answers for the other tests in my IDE but they won't pass on HackerRank. If there is a max time then, why doesn't HackerRank identify that as a requirement?
int minOr = (k - 1) | k;