Company: Capital One_30june
Difficulty: medium
Word from Skeletons Problem Description You are given a string word made up of lowercase English letters, along with a list of strings skeletons , each built from - characters and lowercase letters. Every entry in skeletons has the same length as word . Return the subset of skeletons that can be turned into word . A given skeleton qualifies if every - in it can be swapped for some other character that already appears elsewhere in that same skeleton, producing a string identical to word . If none of the entries in skeletons qualify, return an empty list. Matches must be returned in the order they appear in skeletons , and duplicate entries in the list are allowed. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(skeletons.length x word.length^2) will fit within the execution time limit. Examples Example 1: Input: word = "hello", skeletons = ["he-lo", "he--o", "-ell-", "hello"] Output: ["he-lo", "hello"] Explanation: "h