Ad
  • Default User Avatar

    '~' is a bit operation which inverts bits in number. Bitwise operations works with the integer part of number. So if we use '~~' (double inverting) we get our number in integer representation. In this solution its just rounding number for exclusion zeros before number ('00123' -> '123'). 'c>9' returns true when c>9, true+1 = 2. It's for balance when added.

  • Default User Avatar

    I don't know where is the problem:

    ([2,1,2,3,2,3,2,3,3,3], 3)

    • Expected: 2,1,2,3,2,3,3 Actual: 2,1,2,3,2,3,3 //arrays actually equal!!
      DeleteNthTests
      TestRandom
      System.IndexOutOfRangeException : Array index is out of range.
      at Kata.DeleteNth (System.Int32[] arr, Int32 x) [0x00000] in :0
      at DeleteNthTests.TestRandom () [0x00000] in :0