Multiset Equivalence Problem | C # program to check if two given multisets are equivalent ; sort the elements of both multisets ; Return true if both multisets are same . ; Driver code
using System ; using System . Collections . Generic ; class GFG { static bool areSame ( List < int > a , List < int > b ) { a . Sort ( ) ; b . Sort ( ) ; return ( a == b ) ; } public static void Main ( ) { List < int > a = new List < int > { 7 , 7 , 5 } ; List < int > b = new List < int > { 7 , 5 , 5 } ; if ( areSame ( a , b ) ) Console . WriteLine ( " Yes STRNEWLINE " ) ; else Console . WriteLine ( " No STRNEWLINE " ) ; } }