Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
TypeScript translation added
In JS and TS I assume that it should work for the whole range represented by number so I would include testcase containing a number larger than 2147483647 (Math.pow(2,31) - 1) ie.
doTest([2147483648, 1, 1, 2, 2, 2, 2], 2147483648)
This solution is clever but since it's not included in the description I assume that it should work for the whole range represented by number in JS. Because bitwise operators in JS operate on signed 32-bit integer this solution won't work for any number larger than 2147483647 (Math.pow(2,31) - 1).
findOdd(2147483647, 1, 1, 2, 2, 2, 2) // works fine
findOdd(2147483648, 1, 1, 2, 2, 2, 2) // returns -2147483648