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.
- Prepare
- Algorithms
- Game Theory
- Bob and Ben
- Discussions
Bob and Ben
Bob and Ben
Sort by
recency
|
9 Discussions
|
Please Login in order to post a comment
This was a fun one — XOR problems always force you to think a bit differently. I’ve been into debugging game mechanics lately too, especially around how logic plays out in advance servers. Challenges like this help sharpen that mindset a lot.
Here is Bob and Ben problem solution in Python Java C++ and c programming - https://programs.programmingoneonone.com/2021/07/hackerrank-bob-and-ben-problem-solution.html
C# (as usually short - 1 line - and elegant, no indexing):
Python must be 1-ne as well........
simple java solution, O(1) space and O(number of trees) time