A design tool shows a small badge next to any layer whose name reads the same forwards and backwards. Only letters and digits count: spaces, dashes, and other symbols are ignored, and upper and lower case letters count as the same.
Write isMirrorName(name) that returns true if name reads the same both ways under these rules, and false otherwise. A name with no letters or digits at all counts as mirror-readable.
Input: name = "Top-Spot" Output: true
Keeping only letters gives topspot, which reads the same both ways.
Input: name = "Card 12" Output: false
card12 backwards is 21drac.
0 <= name.length <= 100000name contains printable ASCII characters.Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #96 Mirror-Readable Layer Name. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.