This is because substr prints the number of characters after the starting index. Had you started from 0, you would just need to subtract 1 to exclude the last element.
But since you have started from 1, it has shifted the range by 1, which means the last character is included again. So you need to subtract 2.
JS did not expect solvers to modify original array whereas Python & Ruby require input modification (Either modify JS or change the requirements of the kata to not modify aray)
Enabled in this fork
good shot
It wants the first character removed as well, if you set it to 0 it will also grab that character.
Just curious why is it 1 instead for 0? Isn't the first letter placed at 0?
Great!
Terrible
Done for Python.
Floating point errors:
This is because substr prints the number of characters after the
starting index
. Had you started from0
, you would just need to subtract1
to exclude thelast element
.But since you have started from
1
, it has shifted the range by1
, which means the last character is included again. So you need to subtract2
.According to documentation, the last index is the index of the first character to exclude, rather than the last one to include
Have you gotten an answer yet?
This make sense. You are getting the strings you want directly.
Description should be language-agnostic
Also, The global array in ruby should be
$league_table
Inconsistency among languages:
Reraised as issue
Loading more items...