Same Letter Patterns

Published by supafly in

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

Examples

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

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

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

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

Notes

N/A

Watch a quick demo on how Edabit works.