Given a String pattern as "ABCDFGHK" write a function if input strings like XYZCDFGABHKERYT or LOPIKHFGDCBAYRT should return the starting index of the pattern and if the intput strings are XYZCDFGABBHKERYT or LOPIKHFDBAYRGCT it should return -1.
Do not use any data structures like dict or set to store all the possible combinations of the pattern string.
The interviewer said no to regular expressions too.
I was not able to solve the problem without using data structures like Set or dict etc.
Please help with solution.