does the unordered _set function arranges array elements in sorted manner like maps? Also why did not we just sort the array and carry out the iteration in that array? Will that not optimize space complexity?
Confusion with the code
hello @alankrit.agr99
no unordered_set do not arrange elements in sorted order.
if u want sorted order then use set in place of unordered_set.
yeah this will also work.