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.
When I run
removeZeros([1,null,"5","2",8,6,null,false,"0",0])
in my IDE it returns[1, null, '5', '2', 8, 6, null, false, '0', 0]
.When I run
removeZeros([1,null,"5","2",8,6,null,false,"0",0])
on Codewars it returns[1, null, '5', '2', 8, 6, null, false, 0, '0']
.Eh?! Help pls :D
Okay :/
Yeah... was my bad. All good :)
expected:<false> but was:<true>
But you can reach the goal or do I missunderstand smth here?
Ah okay. Thanks for the explanation. Seems like I need to refactor my solution :D
Yeah, looks like an issue that needs to be fixed. But the result of
solution([-83, 33, -32, 83, -56, -43, 76, 65, -100, 47, 48, 49, 50, 51, 52, -22, -98, 22, 8, -17, -38, -37, -36, -35, -34, -33, -62, 74, 75, 76, 77, 78, 79, 6, 7, 8, 9, 10, 11, 12, 51, 52, -52, -51, -50, -49, -48, -47, -46, -57, 82, 86, 87, 88, 89, 90, 91, -34, -33, -32, -31, -30, -10, -92, 32])
is correct if you have written a working algorithm ;)Ups. Second example is wrong anyways. I was talking about
["NORTH", "WEST", "SOUTH", "EAST"]
. But I think I understand now.This comment is hidden because it contains spoiler information about the solution
I might be wrong, but I think this solution is not entirely correct.
sum_pairs([3, 5, 3, 5, 3, 7], 10)
should return[3, 7]
.However, this algorithm would return
[5, 5]
.Oh! Didn't see xD
This comment is hidden because it contains spoiler information about the solution
This comment got deleted.
Ah. Good to hear :)
Well... even though my code didn't quite get through the attempt, i'm pretty happy with my one liner.
My code does exactly what is written in the requirements (combine the digits of each list and add the resulting numbers together, e.g. [0, 9], [] --> 9 + 0 --> [9]). Therefore the input results for the following inputs should equal:
[0], [0] --> [0] (I mean... even the input test for [0], [] should equal [0]. Why shouldn't this be the case when both lists contain zeros)
[3, 0, 0], [] --> [3, 0, 0]
[0, 5], [] --> [5]
And so on...
Please change :|
A button to delete your own solutions would be helpful. Especially if you accidentally upload another user's solution a second time.
Loading more items...