Use applicative style for sameDigits check in 52.