• + 0 comments

    The substraction is because at the end when are adding the values in vals array together, we shall add "k" to all values in val between "a" and "b", knowing when to stop adding "k" is impossible so we just add k upto the end of the list but subtract it starting from "b"