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.
This code snippet works for both Dart and JS.
This code is written in JavaScript, not Dart, correct?
This comment is hidden because it contains spoiler information about the solution
In fact, this will need to be done in any case, even if it is the first method call. In the worst case scenario where the searched element is the last, this will not be very good for large volumes of data, as was indicated in the condition
nice bro good solution
did not know the function singleOrNull thx for that :)
Suggestions to improve the code:
This line of code
if (iterable[i] != iterable[i+1]) res.push(iterable[i]);
can result on out of bounds
I solved this kata, but you implement clever.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Sorry that is not best practices, there is a formular for this problem, which is much more efficient.
Parenthesis are unnecessary since
&&
has higher precedence than||
Arrow function, great solution!!
Cool
Loading more items...