← Back to challenges

Same Letter Patterns

PythonHardstringsvalidationregex

Instructions

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

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.