You need to sign in or sign up before continuing.×
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 comment is hidden because it contains spoiler information about the solution
I admit—this might be the messiest solution I’ve written. But context matters.
Right now, as I write this, my country is under bombardment. I'm in Iran, living under missile fire from Israel. And no, that’s not an excuse for the "dirty" code—but it's something I need to say out loud.
Maybe this comment will just be a quirky memory—just another coding day under fire. But if things don’t turn out well… maybe Codewars will remember me as the last warrior who fought for freedom with code, even during one of the darkest moments in our history.
Stay strong, stay human. 🕊️
.
Spent 2 hours for not reading properly XD
nice!!
Your debugging is incorrect, and what you print is not what your function receives as input. Add this line as the first line of your solution to see actual input:
System.out.println(stops.stream().map(Arrays::toString).collect(Collectors.joining(",")));
It's pure Java.
In what language?
What I didn't understood?
One test result says:
{12=0, 9=3, 8=1, 10=9}
expected:<19> but was:<26>
AFI understood:
1 -> 12 get in, 0 get out : 12 in
2 -> 9 get in, 3 get out : 12 + 9 -3 = 18 inside
3 -> 8 get in, 1 get out : 18 + 8 - 1 = 25 inside
4 -> 10 get in, 9 get out: 25 + 10 -9 = 26 inside
Why it must be 19?
C#
In Solution section: typo in the method comment : "// retrun" > "// return".
Noup
Now you can Confuse the Devil ;)
its important to understand what the RemoveAt() method does... you may what to consider the position of the i counter once the removal has been done
i was on the right track. i will never give up
hi
Loading more items...