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 {
23
23
24
24
#[ test]
25
25
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 ") ) ;
28
28
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 ") ) ;
31
31
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 ") ) ;
34
34
}
35
35
}
You can’t perform that action at this time.
0 commit comments