Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 689 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 689 Bytes

Find a string

https://www.hackerrank.com/challenges/find-a-string

Problem

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.

Input Format

The first line of input contains the original string. The next line contains the substring.

Output Format

Output the integer number indicating the total number of occurrences of the substring in the original string.

Sample Input 0

ABCDCDC
CDC

Sample Input 0

2

My Solution