tiles: each character is one tile. Using some or all of them, lay out a palindrome, a word that reads the same left to right and right to left.
Case matters: A and a are different letters, so Aa is not a palindrome.
Return the length of the longest palindrome you can lay out.tiles="rraacce" → 7
For example, racecar: the pairs of r, a and c on the sides and e in the middle use all 7 tiles.
tiles="BbbXyy" → 5
Only b and y have pairs, and one leftover tile goes in the middle: for example byXyb, length 5. B and b are different letters and do not pair up.
tiles="Q" → 1
tiles consists of lowercase and uppercase English letterstiles="rraacce"
7
Run checks the first 3 tests in your browser. Submit checks all 70 tests on the server, hidden ones included.