Permutation query Would anyone be able to help here with this one ?
Let $A = \{a, …, z, A, …, Z, 0, …, 9\}$ be some alphabet and let
$$q = q_1, …, q_m \text{ and } w = w_1, …, w_n$$ be finite-length words in $A^*$. 
Find an efficient procedure which decides whether there is a permutation $p: A \to A$ such that $p(w_1), …, p(w_n)$ appears as a consecutive sub-string of $q$.

Hint
Usually, the classic sub-string checking is done using dynamic programming. Could you not try to adapt the dynamic programming approach to this problem directly? Just in the step where you check if a particular sub-string matches your string you will have to check multiset equality.
