Same Letter Patterns

Published by Helen Yu in

Create a function that returns true if two strings share the same letter pattern, and false otherwise.

Examples

same_letter_pattern("ABAB", "CDCD") ➞ true

same_letter_pattern("ABCBA", "BCDCB") ➞ true

same_letter_pattern("FFGG", "CDCD") ➞ false

same_letter_pattern("FFFF", "ABCD") ➞ false

Notes

N/A

Watch a quick demo on how Edabit works.