Flipkart Coding Question – Solved

3 Live
A chat application is building a new immersive feature for their customers to enhance their experience. To train the model for this feature, the developers have prepared a dataset. In the dataset, there are two columns: The first column contains a new search term A (a string written without spaces). The second column contains N unique space-separated words. Task The training model is designed to accept both columns as input and return all feasible sentences after inserting spaces in the search term A, such that: - Each word in the sentence exists in the second column. - A word from the second column can be used multiple times. - Each letter from the search term A must be used in forming the sentence. - The relative positions of the letters in search term A must remain the same in the output. Input Format First line: A string searchTermA, representing the search term A without spacing. Second line: An integer word_size, representing the total number of words in the second column. Third line: N space-separated words, representing the list of words available for sentence formation.

Asked in: Flipkart

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| The supply chain manager at one of Amazon's warehouses is shipping the last con… |
| Determine the highest value after executing n steps on an infinite 2D grid that… |
| Amazon Prime Video is developing a new feature called "Segmentify." This featur… |
| In this new stock prediction game launched on Amazon Games, Player 1 provides P… |
| Amazon operates numerous warehouses, with each warehouse holding inventory[i] u… |
| In Amazon's highly efficient logistics network, minimizing operational overhead… |