Compute max island with constrained flips | Dropbox Interview Question