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
TS did it, no question
TS did it, no issue
locationsToFlood.AddRange(Flood(image, locationsToFlood[0], waterLevel, (row, col)));
Your timeout problem in this row. Don't ask me how I found itSuch doublehits are not passing your sol
locationsToFlood.AddRange(Flood(image, locationsToFlood[0], waterLevel, (row, col)));
Your timeout problem in this row. Don't ask me how I found it
Try to attempt few times with initial solution. If you see more than one submarine, it means that previous are pass the tests. Only last one pic not pass. I tried your previous code, and yes, it working in some cases, but not cover all tests. Read again cases in description, maybe you miss something. Add one more module to print YOUR pic AFTER test
I am not sure that got your question. Join names without commas and don't change their order. If you need more perfomance, use stacks and queues instead of lists, use hashset to not repeat coordinates.
Hello, you are so close with the code you have here. The trouble is not large input values. For example, consider what happens with input of 10. The trouble is that your logic is slightly off when the product is not equal to prod. Think about why that is and I think you will see it.
a quine is a program whose the output is the program/code itself.
Closing this one.
Your recursive method for finding Fibonacci numbers, you build the series from scratch each time you call it.
Hi - first of all, please use spoiler flag any time you post code; everyone can see it and it may spoil the kata for other people.
Secondly - this kata is notorious on Codewars for people seemingly not understanding what to do. Every week someone posts basically the exact same comment about "Why do I get
1064
when answer expects1074
".The simple reason is: you are calculating "locally" the maximum element, row by row, as you move down. However, the "global" maximum is not the same thing: consider this example:
with your approach you will go down the right-hand "branch" of the pyramid because 99>1, and 77>3, and 140>12 so you will get an answer of 2+99+77+140.
But the maximum possible value involves making "bad choices" at first: 2+1+0 but then you get to add the huge value 8000, which gives you a total of 2+1+0+8000 which is greater than your solution 2+99+77+140.
Also, scroll down and read the other comments that explain the same question already since 7+ years:
posted 2hrs ago
comment from 3 weeks ago
comment that links to even more comments
Read the post below yours. You have the exact same problem.