int findSubstring (string s) { vector < int > map (128, 0); int counter; // check whether the substring is valid int begin= 0, end= 0; //two pointers, one point to tail and one head int d; //the length of substring for { /* initialize the hash map here */} while (end
perfect substring geeksforgeeks 2021