Find shortest unique substring per word | Affirm Interview Question