feat(content): function signatures + test cases
This commit is contained in:
@@ -11,6 +11,22 @@ patterns:
|
||||
- union-find
|
||||
- dfs
|
||||
|
||||
function_signature: "def accounts_merge(accounts: list[list[str]]) -> list[list[str]]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { accounts: [["John", "johnsmith@mail.com", "john_newyork@mail.com"], ["John", "johnsmith@mail.com", "john00@mail.com"], ["Mary", "mary@mail.com"], ["John", "johnnybravo@mail.com"]] }
|
||||
expected: [["John", "john00@mail.com", "john_newyork@mail.com", "johnsmith@mail.com"], ["Mary", "mary@mail.com"], ["John", "johnnybravo@mail.com"]]
|
||||
- input: { accounts: [["Gabe", "Gabe0@m.co", "Gabe3@m.co", "Gabe1@m.co"], ["Kevin", "Kevin3@m.co", "Kevin5@m.co", "Kevin0@m.co"]] }
|
||||
expected: [["Gabe", "Gabe0@m.co", "Gabe1@m.co", "Gabe3@m.co"], ["Kevin", "Kevin0@m.co", "Kevin3@m.co", "Kevin5@m.co"]]
|
||||
hidden:
|
||||
- input: { accounts: [["Alex", "a@mail.com"]] }
|
||||
expected: [["Alex", "a@mail.com"]]
|
||||
- input: { accounts: [["David", "d1@m.co", "d2@m.co"], ["David", "d2@m.co", "d3@m.co"], ["David", "d3@m.co", "d4@m.co"]] }
|
||||
expected: [["David", "d1@m.co", "d2@m.co", "d3@m.co", "d4@m.co"]]
|
||||
- input: { accounts: [["A", "a@a.com"], ["B", "b@b.com"], ["A", "a@a.com"]] }
|
||||
expected: [["A", "a@a.com"], ["B", "b@b.com"]]
|
||||
|
||||
description: |
|
||||
Given a list of `accounts` where each element `accounts[i]` is a list of strings, where the first element `accounts[i][0]` is a name, and the rest of the elements are **emails** representing emails of the account.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user