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.
You need to read more, 20th century goes from 1 Jan 1901 to 31 Dec 2000. Source: https://en.wikipedia.org/wiki/20th_century
Thank you :) These little arrow functions come in handy sometimes.
I know about
foreach
, but that wasn't my mistake.for
is actually faster thanforeach
, but only if I don't callcount()
in the condition.So the faster solution should've been:
This way,
count()
only gets called once and everything runs faster.For readability yes,
foreach
is better.PS: This entire solution isn't optimized. I might have rushed through this low level kata, as a distraction on a break from work :)