Friend Circle Queries

  • + 0 comments

    I'd argue union by rank isn't necessary, since you are already using path compression. But it doesn't hurt either and since for this challenge you need to track the size anyway, might as well do it.