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.
OP solved it, closing
Your original code fails for cases where first and last element being the same such as: "ABBCcA"
Your original code fails for cases where first and last element being the same such as:
"ABBCcA"
Though, OP solved it by copying the solution above...
Also, OP's code is retrieving unique values from the list, which is not the requirement of task.
Though OP solved it, closing
Description states:
Your code fails for cases like
[1, 2, 3, 1]
. The expected result is[1, 2, 3, 1]
, but your code outputs[1, 2, 3]
.Description states:
Your code fails for cases like
[1, 2, 3, 1]
. The expected result is[1, 2, 3, 1]
, but your code outputs[1, 2, 3]
.OP solved it, closing.
Done in earlier fork.
Java translation available for review :)
iterable[i] != iterable[i++] is the problem with i++ here, iterable[i++] is equivalent to iterable[i];i++;
Therefore, iterable[i] != iterable[i++] is equivalent to iterable[i]! = iterable[i]; i++
You can modify the code to iterable[i] != iterable[++i]; at the same time, pay attention to whether i is out of bounds
Hi!
You're not doing list comprehension correctly.
See official docs: https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions
This comment is hidden because it contains spoiler information about the solution
probably a 7?
nice
Yeah, I can relate..
Loading more items...