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.
"A lot of these questions are made intentially vague or weirdly worded to increase difficulty and to make you think a little more". No, it's called bad English. We come here to test our ability to think programmatically, not to try and improve our ability to interpret poorly written text.
This comment is hidden because it contains spoiler information about the solution
study on what self does, and how instances of classes work
there is only 1 object tested. example:
x = Arith("five")
print(x.add("seven"))
this should return "twelve"
Please specify the language you are using?
Hi iphark. For this particular kata, research "lookahead assertion", "character set", and how the ^ (carat) and $ (dollar sign) work in regex. Hopefully this helped!
This comment is hidden because it contains spoiler information about the solution
No, I stared at this for a solid 5 minutes before I understood what the author wanted. A lot of these questions are made intentially vague or weirdly worded to increase difficulty and to make you think a little more.
That is an issue of the Kata and not your code - look below at other comments which point out this issue.
However, this issue is only on the example testcases and not the real testcases. The example testcases are just examples of what the testcases look like. You do not need to pass these tests to submit your solution. This means you can just click the "Attempt" button instead of the "Run Examples" button.
Read the description fully. It states that
if v is ommited, fill the array with undefined
, which means that the testcases may call the function without the parameterv
. It gives the error because you are stating thatv
will be the second parameter, however this parameter is omitted.I suggesting looking at default parameter values, where a default value is given to the parameter if it is omitted.
In the random tests smiley faces are generated randomly. You can print out the input arr and see your mistake with
print/echo/console.log
depending on what language you are using.