Aviva Canada Interview Question

Check the equivalence or two random string.