HashedIn OA | Remove adjacent duplicates | How many words can be made from given string
Anonymous User
814

First questions is similar to this https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/
I had done this similar question once [https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/] so with some effort was able to do it.

2nd Problem : You have 2 Strings str and word, you have to find how many words can you make from that given string.
Input : str="This is a test string" word="tsit"
Output : 2
Explanation : there are 4 t's 4 s's 3 i's in the given str, by which you can only make 2 "tsit".
Input: str="Here is HashedIn Technologies" word="neurons"
Output : 0
Explanation: since you do not have 'u' in str. thus u can't form word "neurons".

I was not able to do second one, can someone explain it's solution in python.

Comments (2)