Personal Capital Interview Question

Leetcode problem: shortest word distance