File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
leetcode/src/00451_sort_characters_by_frequency Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ mod tests {
2323
2424 #[ test]
2525 fn test ( ) {
26- let s = String :: from ( "tree" ) ;
27- assert_eq ! ( Solution :: frequency_sort ( s ) , String :: from ( "eert" ) ) ;
26+ let s = Solution :: frequency_sort ( "tree" . to_string ( ) ) ;
27+ assert ! ( matches! ( & * s , "eert" | "eetr ") ) ;
2828
29- let s = String :: from ( "cccaaa" ) ;
30- assert_eq ! ( Solution :: frequency_sort ( s ) , String :: from ( "aaaccc" ) ) ;
29+ let s = Solution :: frequency_sort ( "cccaaa" . to_string ( ) ) ;
30+ assert ! ( matches! ( & * s , "aaaccc" | "cccaaa ") ) ;
3131
32- let s = String :: from ( "Aabb" ) ;
33- assert_eq ! ( Solution :: frequency_sort ( s ) , String :: from ( "bbAa" ) ) ;
32+ let s = Solution :: frequency_sort ( "Aabb" . to_string ( ) ) ;
33+ assert ! ( matches! ( & * s , "bbAa" | "bbaA ") ) ;
3434 }
3535}
You can’t perform that action at this time.
0 commit comments