feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,26 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def is_alien_sorted(words: list[str], order: str) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { words: ["hello", "leetcode"], order: "hlabcdefgijkmnopqrstuvwxyz" }
|
||||
expected: true
|
||||
- input: { words: ["word", "world", "row"], order: "worldabcefghijkmnpqstuvxyz" }
|
||||
expected: false
|
||||
- input: { words: ["apple", "app"], order: "abcdefghijklmnopqrstuvwxyz" }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { words: ["a"], order: "abcdefghijklmnopqrstuvwxyz" }
|
||||
expected: true
|
||||
- input: { words: ["a", "b", "c"], order: "abcdefghijklmnopqrstuvwxyz" }
|
||||
expected: true
|
||||
- input: { words: ["app", "apple"], order: "abcdefghijklmnopqrstuvwxyz" }
|
||||
expected: true
|
||||
- input: { words: ["a", "a"], order: "abcdefghijklmnopqrstuvwxyz" }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different `order`. The `order` of the alphabet is some permutation of lowercase letters.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user