-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
leetcode/src/49-group-anagrams/main_test.go
Lines 28 to 41 in df60c5f
| for _, tt := range tests { | |
| t.Run("groupAnagrams", func(t *testing.T) { | |
| got := groupAnagrams(tt.strs) | |
| for _, g := range got { | |
| sort.Strings(g) // Sort to avoid mismatch due to different order | |
| } | |
| for _, w := range tt.want { | |
| sort.Strings(w) // Sort to ensure the comparison works correctly | |
| } | |
| if !reflect.DeepEqual(got, tt.want) { | |
| t.Errorf("groupAnagrams(%v) = %v, want %v", tt.strs, got, tt.want) | |
| } | |
| }) | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels