Usage of set does not handle duplicates in first array. Replaced it with List implementation. Looks better now\!