Current Solution Approach fails at corner cases. Use HashMap for keeping frequency of elems

interview-questions
Tags: #<Tag:0x00007f242c982f40>

#1

Current Solution Approach fails for imput: [ 6, 6, 6, 2, 2, 4, 4, 4, 2, 2 ]

Can easily be solved using frequency HashMap instead.