https://ujjwalcomputerpro1.medium.com/spoj-all-character-pattern-problem-1-to-8-approach-0d915f171f31