Flipkart Coding Question – Solved

8 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

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |