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.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
This is brief:
https://www.w3schools.com/jsref/jsref_obj_regexp.asp
You need x at z[0]. If i would be 0 your z[0] would be always 0. Multiply by 0 is alwyas 0.
This comment is hidden because it contains spoiler information about the solution
this was hard for me as a beginner, took me like 5 hours to figure out
Smart but dangerous. Ofc its 8 kyu kata and we shouln't be worried about security aspects.
8 kyu and I can't complete this task :\
It's one of the oldest katas on the site so ranking/difficulty grading is a bit out of date.
Besides, if you think it is too easy; why not try to solve it in O(1) rather than your O(n) solution which times out for inputs ~
100,000,000
?It should be 8 kyu instead 6 kyu