December 24, 2018
Counting the number of occurrences of the string
Threads: Enter two strings s1 and s2 on. Count the number of occurrences of s2 in s1. Not case sensitive.
Input: two lines, each containing a string respectively s1, s2.
Output: Some of the frequency of occurrence of s2 in s1.
For example:
input: Dao Thi Hong Mai Hoa Who output: 1
You are not logged in? Log in to Submit Now!
12 Comments
Add a Comment
You must be logged in to post a comment.
Test case number 2 (hhhhhh) really bad.
This case must be reconsidered, hh appeared from the location 0 to the location 1 then can't calculate from position 1 to the location 2 again.
hh.hh.hh –> hh appeared 3 time.
Count it all up
Test number 3 hhhhhh hh the output should be 3 but why is it? 5 @@
5 Yes that
hh.hh.hh it's 3 time
Case 4 =)))))))))))
This website is a bit buggy :((( keep processing
Maybe the system didn't handle it in time. Or you use java takes a long time to compile
Can you please tell me why I run chrinh on my computer with the same test results as you, but I run it here again and I get an error??
Please pay attention to a few points about the series in the submission instructions. There may be slight differences between compilers.
it keeps getting in queue bro :((
Can you please try again?.
Sao case 3 test on vstudio, the result is equal to 5 in which the output is equal to 6 So :(((