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.
Although there are better ways to implement this kata, your algorithm should also work, as long as you fix two problems.
[1, 1, 3, 8, 8] is invalid input.
if DR is executed endlessly (i.e. DRDRDR...) it will fall into the hole at (5,5)
if DRD is executed endlessly, it will leave the area on the down side.
(6, 9, 9 - 9) = (6, 9, 0) step can't be done.
Apart from the case in which a ban phrase is a subset of another longer ban phrase, there should also be an explanation about the case in which a ban phrase isn't a subset of another ban phrase, yet share common words.
For example, what should be the answer for below situation?
You should think about the case in which the user's rank is 8 and incProgress is called with level 9
You should know about how comparisons of strings work.
e.g) 10 > 2 but "10" < "2"
If "initialValue" is not specified, reduce function takes first element as "initialValue". Therefore, if there's a single element in the list, your function would just return first element of the list, which might not be number.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
I guess you are not familiar with c.
You should figure out how to compare strings in c.
I guess you are joining strings by String operations. (e.g. output += "1")
Try using StringBuffers instead.
...
} else if (finalWords.contains("7")) {
arrOfWords[6] = finalWords;
}
...
Above is the wrong part. I guess you can easily fix it by yourself :)
sqrt
means a square root, which is confusingYou should have meant
square
here, shouldn't you?