Question: In given string, find whether it contains any permutation of another string. For example, given abcdefgh and ba, the function should return true, because abcdefgh
In given string, find whether it contains any permutation of another string. For example, given "abcdefgh" and "ba", the function should return true, because "abcdefgh" has substring "ab", which is a permutation of the given string "ba".
Step by Step Solution
3.38 Rating (164 Votes )
There are 3 Steps involved in it
To solve this problem efficiently we can use a sliding window technique combined with frequency counting Heres a Java code implementation of the solution import javautilHashMap import javautilMap publ... View full answer
Get step-by-step solutions from verified subject matter experts
