Apple Interview Question

Leetcode medium based on backtracking and string