feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,24 @@ categories:
patterns:
- hashing
function_signature: "def group_anagrams(strs: list[str]) -> list[list[str]]:"
test_cases:
visible:
- input: { strs: ["eat", "tea", "tan", "ate", "nat", "bat"] }
expected: [["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]
- input: { strs: [""] }
expected: [[""]]
- input: { strs: ["a"] }
expected: [["a"]]
hidden:
- input: { strs: ["abc", "bca", "cab", "xyz", "zyx"] }
expected: [["abc", "bca", "cab"], ["xyz", "zyx"]]
- input: { strs: ["", ""] }
expected: [["", ""]]
- input: { strs: ["listen", "silent", "enlist"] }
expected: [["listen", "silent", "enlist"]]
description: |
Given an array of strings `strs`, group the **anagrams** together. You can return the answer in **any order**.