problem
solution
C++ solution
1 | class Solution { |
Python solution
1 | class Solution: |
analysis
- time complexity
O(n + m)
, m = queries length, n = words length - space complexity
O(n + m)
1 | class Solution { |
1 | class Solution: |
O(n + m)
, m = queries length, n = words lengthO(n + m)