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.
Java translation
C# Translation
Javascript translation:
https://www.codewars.com/kumite/64058635b2dd990031b7ece4?sel=64058635b2dd990031b7ece4
Excellent execution, poor idea:
routers
is suboptimal and adds artificial difficulty to the task. Since all we care about is its length (as defined by the location of the firsttrue
element in the array), it might as well be passed in as a single integer"packet received"
/"packet dropped"
), it might as well be a boolean, e.g.true
if packet received,false
otherwise. Alternatively, for improved expressiveness (over a boolean), useenum
s insteadBut once those two points are addressed, the solution devolves into
routers < ttl
, which is trivial. Hence I'm not sure if the Kata idea itself is salvageable (-: