• + 0 comments

    Isnt it kinda weird that the author seem to mean index 0 in their queries but uses "1" instead, e.g., for query 1 3 we actually mean the first list (1). It means that we need to shift the index so that when we assign int x to the value, it should be x = value -1 (and int y = value -1).

    Its not wrong, it just felt like adding an unneccesary layer of complexity. Perhaps its part of the exercise, i could also misunderstand the reasoning behind it.

    The solution, as i see it is to shift the lists in both images and in the tests, so images show lists 0, 1, 2, 3 ,4 ... instead of 1,2,3,4,,, and so the test doesnt expect the list in place 1 but rather in place 0