Same Letter Patterns

Published by Matt 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.