To clarify, "subarray" is defined like, for example:
if A="abc" B="??a???b????c???" then A is subarray of B.
version I. iterate bigger string. ~~~~~ for(int i=0;i<B.size;i++){ if(curA<A.size && A[curA]==c )curA++; } if(curA==A.size) return true;~~~~~
version II. iterate small string