Skip to content

Latest commit

 

History

History
20 lines (11 loc) · 405 Bytes

File metadata and controls

20 lines (11 loc) · 405 Bytes

Count Substring

Objectives

In this challenge, the user enters a string and a substring. You have to print the number of times that the substring occurs in the given string. String traversal will take place from left to right, not from right to left.

NOTE: String letters are case-sensitive.

Sample Input

ABCDCDC CDC

Sample Output

2

Solution

Click here to view the solution