Welp, here it is folks! I finally sat down and faced my nightmare. The question Amazon gave me during the interview that I
basically blew (Well, it actually passed about half of the unit tests, but god knows how it even did that. The code was terrible
and had a lot of issues). The first coding question they gave me was Number of Islands which I’ve probably solved on this blog?
If I haven’t, it’s pretty easy. THIS one, however, is a bit more tricky. It’s definitely not elite-level hacker hard, but there
are some subtle things you have to be aware of if you want to solve this problem.
I chose Java. Why? Because I hate myself. No, but seriously, that’s almost all I do at work these days, so it just felt easier.
Could you do this faster in other languages? Yes, of course. Could you do it faster in Java? Absolutely, but I’m not really interested
in optimizing a toy problem when the code I have solves it quickly enough and is incredibly easy to understand. You could minimize the
lines a bit as well, but I’m just going to leave this one as is.