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.
This comment is hidden because it contains spoiler information about the solution
the if condition would drop all the 'centenarian (at least 100 years young)' !
just a reminder for those who missed the comment ...
this solution would only work if the term 'teen' is defined as 'any age lower than 20'
aka, would not pass test case such as [5,25,35,45,55,65,75,85,95,105]
thanks. I didn't know naming groups and groupdict()
Let me see if I'm getting this right, sequence(4) only includes numbers from 0 to 3, not 4 itself.
Then shouldn't sequence(4) return 7 instead of 9? Since 7 wouldn't form arithmic progression with any two numbers from: 0,1,2,3
I'm really lost here... how come sequence(5) should return 10??
Doesn't 0,5,10 form arithmic progression? Shouldn't it be 12 instead??
Also, is the given input part of the sequence or not?
I feel like this kata doesn't give enough examples, could have put in more examples, for example sequence(6), sequence(7).
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'd never thought of using reduce on this one! Neat!
I see, that's new to me :) Thank you
references for anyone interested:
https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation
https://stackoverflow.com/questions/8006551/how-to-split-long-regular-expression-rules-to-multiple-lines-in-python/8006611
Is this verbose regex? how did you manage to write it in mulit-lines with comments without using verbose flag?
woww I did NOT know you can put comments inside regex if you triple quote it...
learned something new about verbose regex :)
actually it will pass all negative cases.
try with (-5,-4,-3) and (-2, -1, 1) and (-1,1,2)
the negative number will always contribute negatively to the sum of a+b hence it will never pass the test a + b > c
aha... i must be trippin...
I thought changes in shallow copy will affect both lists
What's the difference between mutating the list VS changing the list?
I thought it's the same thing...
Loading more items...