Ad
  • Default User Avatar

    Unfortunetly thats true, instruction is contradictory in one place

    "negative-base number being one digit longer than its positive-base equivalent"
    ...
    "For example, the representation for 6 is '11010' and -6 is '1110'."

    Negativ is shorter here, so people are disoriented. I am.

  • Default User Avatar

    Unfortunetly test for number longer then 9 digits cant be done under 12 sec (numer 123456789 one in ~9 sec), unless it's realy high tec coding.

    Ok, done the calculations below 0.001 sec but it took me 3 hours to come up with proper mathematical algoritm.
    So if you can't finish the test in time with last number (1234567890), just now that its all about matemtics and not programing skill, so dont beat your self down.

  • Default User Avatar

    For all you recurrence users, remember that your sollution will NOT work properly for all range of input parameter. Since input parameter is int, it should work for all (lets say it's positiv) values. Since you are using double recurrence, using any number grater then (int.MaxValue / 2) will fale with sad "Stack overflow" error.