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.
@atenea_nature, you mean to use
Math.toIntExact()
instead ofMath.round()
for calculations ?Math.round gives a long, you need to use toInt(). At least I solved the problem that way
Thank you !
For Regex learning: https://www.regular-expressions.info/tutorial.html
For Regex testing/debugging: https://regex101.com/
For Streams: https://www.youtube.com/watch?v=f5j1TaJlc0w - there are more similar tutorials on the YT, if you don't know lambas - learn them first.
Issue with your code is not a kata issue! When I ran your code, there's
division by zero
error, so your logic is wrong! And you don't need to includemain
in your solution, FYI!This comment is hidden because it contains spoiler information about the solution
Still learning java, I'm noticing that a lot of problems on codewars are solved in a similar fashion to yours or using regex. I'm not familiar with java.util.stream or regex ... iwould appreciate any study resources you can share that might help me.
Being frustrated is not a kata issue, sorry.
BTW there is no need to round everywhere... Did you read the details of the example?
I was really frustratd by this kata, Math.round and Math.ceil didnt do anything for me, I would pass all the tests but fail one out of five on the attempts due to rounding error.
log is 331 expected 332
log is 112 expected 113
FRUSTRATING !
This comment is hidden because it contains spoiler information about the solution