is there a way in Scala to compare two sequences in a way that it returns true if it contains the same elements, regardless of order and repetitions?
Seq("1", "2") vs Seq("2", "1") => true
Seq("3", "1", "2") vs Seq("2", "1", "3") => true
Seq("1", "1", "2") vs Seq("2", "1") => true
Thanks
ps this is not a duplicated of this because it also asks to exclude duplicated from the check and it is using SEQ instead of LIST.
Convert to sets and compare those
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With