Ad
  • Default User Avatar

    Hi,

    Yes, it's helpful, solution is fine now.

    I misunderstood the issue condition: i thought, that original sequence in formats {i, i+1, ..., i+n} or { i, i, ..., i}, but it's not...

  • Default User Avatar

    Hello.
    I have a problem in Java, my solution test result: basicTests & edgeTests - ok, but randomTests: arrays first differed at element [0]; expected:<1> but was:<10>.

    There are these situations (i think so):

    1. Array contains 1 int:

    1.1. int = 1, output = 2 (example: 1 -> 2)

    1.2. int !=1, output = 1 (example: 42 -> 1)

    1. Array contains 2 or more int and all int equals:

    2.1. all int = 1, output = 1...1, 2 (example: 1,1,1 -> 1,1,2)

    2.2. all int > 1, output = int-1, int...int (example: 42,42,42 -> 41,42,42)

    1. Array contains 2 or more int and all int not equals (sequence: int, int+1, int+2, ..., int+n)

    3.1. first int = 1, int+n -> 1 (example: 1,2,3,4,5 -> 1,1,2,3,4)

    3.2. first int > 1, int+n -> int-1 (example: 3,4,5,6,7 -> 2,3,4,5,6)

    What's problem with it? Why random tests generates error? :(