7 kyu
Return substring instance count
2,016 of 8,730jhoffner
Description:
Write a function that takes two string parameters search_text
and full_text
and returns the number of times the search_text
is found within the full_text
.
- Overlap is not permitted:
"aaa"
contains1
instance of"aa"
, not2
. search_text
will never be empty.
Examples:
full_text = "aa_bb_cc_dd_bb_e", search_text = "bb"
--> should return 2 since "bb" shows up twice
full_text = "aaabbbcccc", search_text = "bbb"
--> should return 1
Strings
Fundamentals
Similar Kata:
Stats:
Created | Apr 13, 2013 |
Published | Jul 24, 2013 |
Warriors Trained | 11500 |
Total Skips | 975 |
Total Code Submissions | 28193 |
Total Times Completed | 8730 |
Ruby Completions | 2016 |
JavaScript Completions | 3382 |
CoffeeScript Completions | 246 |
Python Completions | 2749 |
C# Completions | 335 |
Haskell Completions | 78 |
C Completions | 70 |
Java Completions | 87 |
Total Stars | 75 |
% of votes with a positive feedback rating | 90% of 1000 |
Total "Very Satisfied" Votes | 826 |
Total "Somewhat Satisfied" Votes | 144 |
Total "Not Satisfied" Votes | 30 |