Check strings against dictionary efficiently | Reevo Interview Question