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.
The if (slen < eLen) checks whether the ending string is longer than the str. If it is, it's impossible for str to end with ending, because a shorter string cannot contain a longer suffix. This is a necessary optimization that saves computation time by immediately returning false in such cases.
You are correct in observing that this condition indirectly accounts for empty strings, but its main purpose is to enforce a size constraint for the suffix check.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That doesn't matter. Just passing the test matters.
Iterating over bytes, or runes, doesn't matter here. This logic does in fact work in other languages, because I used this logic in other languages to solve this, such as C#, JavaScript, Python, and Ruby.
Go be cancerous somewhere else.
Correct. However, you will see a lot of wtf stuff at 8 kyu when the person is new lol.
I think your right.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Some kind of issue with TypeScript.
TSError: ⨯ Unable to compile TypeScript:
test.ts:3:27 - error TS2306: File '/workspace/default/solution.ts' is not a module.
3 import solution = require('./solution');
~~~~~~~~~~~~
test.ts:1:22 - error TS6053: File '/runner/typings/mocha/index.d.ts' not found.
1 ///
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.ts:2:22 - error TS6053: File '/runner/typings/chai/index.d.ts' not found.
2 ///
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think that was it. My solution is wrong, but the output in the test is no longer truncated. Thanks!
This comment is hidden because it contains spoiler information about the solution
Kata that lacks meaningful test shouldn't be pushed through. This was JavaScript.
expected '0.1.2.2.3.2.3.4.3.5.3.6.7.4.8.3.7.9.7…' to equal '0.1.2.2.3.2.3.4.3.5.3.6.7.4.8.3.7.9.7…'
This comment is hidden because it contains spoiler information about the solution
Loading more items...