7 kyu
Palindrome Pairs
60 of 711smepple
Description:
Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.
Examples:
["bat", "tab", "cat"] # [[0, 1], [1, 0]]
["dog", "cow", "tap", "god", "pat"] # [[0, 3], [2, 4], [3, 0], [4, 2]]
["abcd", "dcba", "lls", "s", "sssll"] # [[0, 1], [1, 0], [2, 4], [3, 2]]
Non-string inputs should be converted to strings.
Return an array of arrays containing pairs of distinct indices that form palindromes. Pairs should be returned in the order they appear in the original list.
Lists
Strings
Fundamentals
Similar Kata:
Stats:
Created | Jun 28, 2016 |
Published | Jun 28, 2016 |
Warriors Trained | 1500 |
Total Skips | 27 |
Total Code Submissions | 4452 |
Total Times Completed | 711 |
Ruby Completions | 60 |
JavaScript Completions | 318 |
CoffeeScript Completions | 11 |
Python Completions | 365 |
Total Stars | 29 |
% of votes with a positive feedback rating | 85% of 200 |
Total "Very Satisfied" Votes | 150 |
Total "Somewhat Satisfied" Votes | 39 |
Total "Not Satisfied" Votes | 11 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |