I looove recursion. It is often the first thing that comes to mind. There are usually better algorithms, but in this particular case this was the right one. (I think.)
By the way, you're the first follower i have! Thank you! I'll do my best not to disappoint you. :)
That's not entirely true. I have some experience in programming, but i'm learning Python now too, just like you.
I found that problem difficult, yet very interesting. Good luck!
Congratulations! I always love the feeling when i get that big green button after having wrapped my mind around a difficult problem.
I've only been a member for a few weeks. This took me just a couple of hours, but there are other 3-kyu problems i couldn't yet solve. (This one took me some 12 hours, for example: https://www.codewars.com/kata/58905bfa1decb981da00009e/train/python .)
I looove recursion. It is often the first thing that comes to mind. There are usually better algorithms, but in this particular case this was the right one. (I think.)
By the way, you're the first follower i have! Thank you! I'll do my best not to disappoint you. :)
Great minds think alike? :)
result
is a list, and in python,[]
(the empty list) is evaluated toFalse
when cast to boolean.bool([]) -> False
bool(['a']) -> True