I cannot understand how the output is coming please help.
Doubt in output understanding
Hi. So in this question we are basically given an array of strings and a target string. we have to return the minimum no of strings we can choose from the array such that after picking some of the characters from a particular string and rearranging it we can form the target string.
Consider the example -
Input: stickers = [“with”,“example”,“science”], target = “thehat”
Output: 3
Explanation: We can use 2 “with” stickers, and 1 “example” sticker.
now the first 2 characters of the target string ie. “th” can be obtained from the string “with”, e & a of target string can be obtained from “example” and again t & h can be obtained from “with”.
Thus we can use 2 “with” stickers, and 1 “example” sticker.
Hope this clears ur doubt.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.