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.
Your solution is not good. Every good boy just use O(1) memory and O(n) time, you use O(n) memory.
Good work!
good work!
In the example there is a little typo
=
should be==
To clarify ,
==
(equality operator) in JavaScript will convert types when comparing.For example,
return 5 = '5'
will returntrue
even though it is comparing a number and a string.This is because JavaScript will convert them to the same type when comparing.
Using
===
(strict equality operator) will not convert type so the above example would returnfalse
This comment is hidden because it contains spoiler information about the solution
==
is never enough.==
bites.==
is inexplicable bugs waiting to happen.===
is much more predictable and untemperamental.