• + 3 comments

    Wouldn't it be easier to use HashSet instead of HashMap? The size of your size is the number of unique element in your subarray.