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.
of course. only change constants.
but the testcases are against that
do you know the concept of null-safe methods? null is not same as empty
I think that string formatting inside loop is slower than
stb.WriteString
. Am I wrong?Even better using
new StringBuilder(initialLength)
constructor since final string length is predictable to avoid memory copy when internal buffer is exhaustedbut not for hugh strings efficiently
I thik its innefficient on very hugh strings. Better check one rune by rune to get Unicode-16 full
Fails on strings with subrrogates. It's better transform before to rune slice to get a full support
It only works well on strings where characters are formed by one codepoint. fails for surrogates.
So better use iterators instead access in a binary way
str.split(...)
makes strings be corrupted (eg. emojis are splited into 2 codepoints).Better use
Array.from(str)
to convert it to array safetyThis comment is hidden because it contains spoiler information about the solution
Inefficient for huge strings. better use iterators to check codepoints one by one
Thanks
Ahhhh, ok!
It was for support all optional things mentioned in kata's description such as hastag or 3/6 length color too validating . And using bitwise operators to refresh knowledge
lol
What is the amazing thing?
It's a bad idea mutate input array with
shift()
Loading more items...