It was similar to this: https://leetcode.com/discuss/interview-question/912928/amazon-oa-2020-gifting-groups-friend-circle-lc-doesnt-solve-this
NOTE: It's not the same as Number of Islands.