A CSS linter wants to flag class names that are just another class name with its characters shuffled.
Write sameLetters(a, b) that returns true if b uses exactly the same characters as a, each the same number of times, in any order. Upper and lower case count as different characters.
Input: a = "btn-primary", b = "primary-btn" Output: true
Both strings use the same characters the same number of times.
Input: a = "card", b = "cart" Output: false
card has a d and cart has a t.
0 <= a.length, b.length <= 10^5Run 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 #15 Shuffled Class Name Check. 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.