Ported interview question to new testcase style
It's more efficient to iterate over the map's keys than the whole string again