Word Quest Clue Matching

Company: Amazon_20thjune

Difficulty: easy

Problem Statement

Word Quest Clue Matching Problem Description You are playing a word-based quest game with two arrays: a list of names (people, fruits, animals and so on) and a list of character clues . Each name stands for a player, and the clues are letters that point you to the players whose names hold the required letters. A player is valid when its name contains all the clue letters, including repeated letters as many times as they are repeated in the clues, and in the order the clues give them. Reading the name from left to right, you must be able to meet clue 1, then clue 2, then clue 3, and so on. In other words, the string formed by joining the clues must be a subsequence of the name. (inferred -- the source asks for every clue character "including multiple occurrences" and "in the order hinted by the clues", and its second example rejects elephant for the clues a e because no e comes after the a; the subsequence reading is the one that matches both examples.) Return every valid player togethe