Company: Capital One_30june
Difficulty: medium
Word from Skeletons Problem Description You are given a string word consisting of lowercase English letters, and a list of strings skeletons consisting of - characters and lowercase English letters. Every skeleton will always be the same length as word . Your task is to return a list of skeletons that can form the given word . A skeleton can form a word if all - characters can be replaced with other characters taken from the same skeleton to make the string equal to the word . If no strings within skeletons can form the given word by doing this, return an empty list. The matching skeletons should be returned in the same order they appear in skeletons and the list of skeletons may not all be unique. 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