Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The author means that there won't be a negative amount of passengers, so WE don't need to error check for his tests.
In the problem condition the author suggests that passanger rest in the bus ALWAIS (for any bus stop) great or equal to zero. But tests don't check this!
I don't undestand:
arrays = [[-8, -8], [0, -6], [4, -8], [2, -4], [-2, 4], [-1, -5], [7, -2], [-5, 4]]
shift = 1
my result: [-8, -8, -2, -6, -6, 3, 2, -7, 4]
estimated result: [-8, -8, 0, -6, 4, -8, 2, -4, -2, 4, -1, -5, 7, -2, -5, 4]
Manually:
-8 -8
0 -6
4 -8
2 -4
-2 4
-1 -5
7 -2
-5 4
-8 -8 -2 -6 -6 3 2 -7 4 # as in my solution
Why estimated result is -8, -8, 0, -6, 4, -8, 2, -4, -2, 4, -1, -5, 7, -2, -5, 4 ???
Such result is correct for shift = 3
This comment is hidden because it contains spoiler information about the solution
You forgot that ascii-code contains some symbols wich ascii-number less than ascii-code for digits, for example '#@%'. So, if input string will contain words with one of those symbols, your solution will work wrong.
Try this: "A9# fg1 ghji3%"
This comment is hidden because it contains spoiler information about the solution
This code don't pass the test below:
[[2,4], [2,6], [2, 8]] -> [[6, 12], [4, 12], [3, 12]]
See kata condition for Bash