I had two questions in the Phone Screen interview:
Q1: https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/
- Solved the first question with O(n) - Time complexity and O(1) - Space complexity. It took me around 15-20 minutes to explain the process and to write the code
Q2: https://leetcode.com/problems/valid-word-abbreviation/
Given a pattern similar to i18n check if the input string matches it.
Examples:
- f6k should match facebook, but not focus
- Similarly F2eb2k or 8 should match Facebook
- Print(match("8k", "Facebook")) # Return Fasle
- Print(match("8k", "Faceboook")) # Return True
- Print(match("F2eb2k", "Facebook")) # Return True
- Print(match("i18n", "internationalization")) # Return True
- Print(match("i18n", "interpolation")) # Return False