Ad
  • Custom User Avatar

    natan,
    I don't know how this test case worked but... "Attempt" did trigger this issue (0112 -> 2110). So if you ask me to remeasure (I couldn't, because "Attempt" blocked me from submission due to failure).

    But as i mentioned... treating an Int in swift or Java, 0112 is the same as 112 (This happens before conversion of string). I would propose if we do find it, we should remove it.

  • Custom User Avatar

    http://onlineswiftplayground.run/
    It doesn't seem to matter if it's string or not, the simple test here seems to show otherwise.

    var test1 = 0122
    var test2 = 122

    print("Test one values (test1)") < -- "122"
    print("Test Two values (test2)") <-- "122"
    print(test1 == test2) <-- True

  • Custom User Avatar

    I just want to check, if my answer is incorrect. It seems that swift Int, removes leading zero by default.. So one test doesn't work:
    0112 -> 2110

    It seems that leading zero is removed in swift by default, hence 0112 when assigned is changed to 112. I want to know if anyone else dealt with this before (I've even used playground in swift to check)