Question: Write a C program that reads two strings S and T and an integer N. Check if string T occurs in the suffix of S
Write a C program that reads two strings S and T and an integer N. Check if string T occurs in the suffix of S starting at position N.
Note:
Strings are indexed from 0.
The suffix of S starting at position N is the last |S|-N characters of S. |S| is the length of S.
Input Description:
String S
String T
Integer N
Output Description: Print 1 if string T occurs in string S after position N, else print 0.
Example:
Input:
abcdbca
bc
4
Output: 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
