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.
Xoring Ninja
Xoring Ninja
Sort by
recency
|
47 Discussions
|
Please Login in order to post a comment
Please assist me in that only half of my test cases pass and the other half krunker provide a runtime error.
Here is Xoring Ninja problem solution in Python Java C++ and c programming - https://programs.programmingoneonone.com/2021/07/hackerrank-xoring-ninja-problem-solution.html
I don't know how it works but i observed the following pattern: 1, 2, 4, 8 = 120 1, 2, 4, 8, 6(4+2) = 240 1, 2, 4, 10(8+2), 8 = 240 1, 2, 4, 10, 6, 8, 3 = 960 = 120 * BigInteger.Pow(2, arr.count - 4(1 2 4 8 ) //you should use the above examples to solve it rather than look at the code :) //it took me a lot of time and i changed my code several times because i didn't use BigInteger and i was right from the beginning. public static int xoringNinja(List arr) //C# {