Longest Prefix Matching Leetcode Solutions