← Back to challenges

Same Letter Patterns

JavaScriptHardstringsvalidationregex

Instructions

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

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