• + 0 comments

    Think carefully about the keys used for the map; you can easily create intermediate values which already indicate the sets each integer appears in - no need to do this in the reduce.