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.
thank u i see it
wow! this is
OP had an off-by-one error in their
for
loop: loop counteri
goes to14
but thepattern
variable has14
characters, so the last iteration accessesphnum
out-of-boundsThe C tests seem fine. Without more information, I'm going to close this issue.
This code is mostly correct. You are using a template string in your return value, and template strings will create exactly what you write in them... so your current return value includes extra quotation marks, extra spaces, and even linebreaks. So, for example, if the correct return value is
(123) 456-7890
, your function is returning the following (I'm using underscores to show spaces here, your return value does not contain underscores, they are spaces in your return value):As a further note, you don't need to call the function yourself at the end of the code, the tests will do that for you. In this case, it doesn't matter that you call it yourself, though.
This comment is hidden because it contains spoiler information about the solution