MyHeritage Interview Question

Check if 2 strings are equal by some rules