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.
I did it in 628. Then I realized there were free letters from the get-go. DandDangDang!
After this kata, you will feel an overwhelming sense of gratitude for having permit to type the letters of the alphabet.
Hats off! I found this one quite challenging!
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Could you explain to me (s.length / 2 - 1) ? To me it is saying find the middle and move the index down one in case it is an even number string length so you can return both numbers. I don't get it, I do understand the deprication of substr and I used substring in my solution. Or if you could maybe explain what the (s.lenght / 2) - 1 means that will help as well.
No random tests (must also generate cases below)
Missing fixed, sample tests for valid cases below:
########## ext. # (3-digit
areacode
+ 3-digitlocal3
+ 4-digitlast4
+ extension)-->
aF[}2654871290D~]:gF;X012345
Above case with leading
1
-->wV: 15754437619At,xfD90
(Note:1575
with leading1
)1(###) ###-#### (
1
followed immediately by 3-digitareacode
+ 3-digitlocal3
+ 4-digitlast4
)-->
a1234-567AbCd8901~:)SD
(###) ####### ext. # (3-digit
areacode
+ 7-digit combined (3-digitlocal3
+ 4-digitlast4
) + extension)-->
!046f*S;b J2634114 extensio91243445445
Above case with leading
1
-->!1046f*S;b J2634114 extensio91243445445
(Note1046
instead of046
)(###)### #### ext. # (6-digit combined (3-digit
areacode
+ 3-digitlocal3
) + 4-digitlast4
+ extension) -->254780gR]}\~fdn dA1234zyXtdfd01234567
Above case with leading
1
-->1254780gR]}\~fdn dA1234zyXtdfd01234567
(Note1254780
instead of254780
)This comment is hidden because it contains spoiler information about the solution
A string also has a length property. Don't need to convert the string to an array with
split()
.substr is deprecated
This comment is hidden because it contains spoiler information about the solution
Diagonal lines are tested, but the line drawing algorithm is not specified. There are at least several possible line drawing algorithms.
This comment is hidden because it contains spoiler information about the solution
Does this kata require any specific node.js functionality?
Good code, but unnecessarily big.
No need to use Math.ceil (if you don't use decimal numbers) and ternary operator.
Check my solution.
Thanks! Mine was so ugly compared to this.
Loading more items...