BNP Paribas Interview Question

Standard Leetcode question on substrings