Bro
You even know how to use key in sorted function
it took me nearly as long as you, as long as you get it working in the end it's no biggie
That basically allows you to Increment by 2 in the for Loop, syntax is as follows:
for i in range(beginning, end, step)
Example: for i in range(0, 12, 2) will iterate through numbers 0 to 12 incrementing by 2 every iteration so (0, 2, 4, 6, 8, 10)
This comment is hidden because it contains spoiler information about the solution
Try looking at this https://docs.codewars.com/training/troubleshooting/#works-but-no
input: [1, 3, 2, 5, 7, 9, 4, 6, 8] [4, 9, 8, 2, 6, 0, 3, 7, 5] [7, 0, 6, 3, 8, 0, 2, 1, 9] [6, 4, 3, 1, 5, 0, 7, 9, 2] [5, 2, 1, 7, 9, 0, 8, 4, 6] [9, 8, 0, 4, 2, 6, 5, 3, 1] [2, 1, 4, 9, 3, 5, 6, 8, 7] [3, 6, 0, 8, 1, 7, 9, 2, 4] [8, 7, 0, 6, 4, 2, 1, 3, 5] Expected result = False Returns True
my code on the site returns True, but on my code editor returns False, is it bugged?
@akar-0 sorry, wont happen again
you need to put the 'return sum' inside your function
Loading collection data...
Bro
You even know how to use key in sorted function
it took me nearly as long as you, as long as you get it working in the end it's no biggie
That basically allows you to Increment by 2 in the for Loop, syntax is as follows:
for i in range(beginning, end, step)
Example: for i in range(0, 12, 2) will iterate through numbers 0 to 12 incrementing by 2 every iteration so (0, 2, 4, 6, 8, 10)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Try looking at this https://docs.codewars.com/training/troubleshooting/#works-but-no
input:
[1, 3, 2, 5, 7, 9, 4, 6, 8]
[4, 9, 8, 2, 6, 0, 3, 7, 5]
[7, 0, 6, 3, 8, 0, 2, 1, 9]
[6, 4, 3, 1, 5, 0, 7, 9, 2]
[5, 2, 1, 7, 9, 0, 8, 4, 6]
[9, 8, 0, 4, 2, 6, 5, 3, 1]
[2, 1, 4, 9, 3, 5, 6, 8, 7]
[3, 6, 0, 8, 1, 7, 9, 2, 4]
[8, 7, 0, 6, 4, 2, 1, 3, 5]
Expected result = False
Returns True
my code on the site returns True, but on my code editor returns False, is it bugged?
@akar-0 sorry, wont happen again
you need to put the 'return sum' inside your function
This comment is hidden because it contains spoiler information about the solution