Ad
  • Custom User Avatar

    Nice, first recursive solution I see here (not super efficient, but nice). As a note, you could have skipped storing inhab as a separate variable and having if logic over it, at the cost of 1 more iteration :) - check my solution.. (I wrote it for fun in Scala then translated it in Java)