Count occurrences of substring X before every occurrence of substring Y in a given string
Given three strings S, X, and Y consisting of N, A, and B characters respectively, the task is to find the number of occurrences of the substring X before every occurrence of the substring Y in the given string S. Examples: Input S = âabcdefdefabcâ, X = âdefâ, Y = âabcâOutput: 0 2Explanation:First o