5 kyu
Return substring instance count - 2
627 of 3,173ineiti
Description:
Complete the solution so that it returns the number of times the search_text is found within the full_text.
search_substr( full_text, search_text, allow_overlap = true )
so that overlapping solutions are (not) counted. If the searchText is empty, it should return 0
. Usage examples:
search_substr('aa_bb_cc_dd_bb_e', 'bb') # should return 2 since bb shows up twice
search_substr('aaabbbcccc', 'bbb') # should return 1
search_substr( 'aaa', 'aa' ) # should return 2
search_substr( 'aaa', '' ) # should return 0
search_substr( 'aaa', 'aa', false ) # should return 1
Strings
Regular Expressions
Algorithms
Similar Kata:
Stats:
Created | Aug 24, 2013 |
Published | Aug 24, 2013 |
Warriors Trained | 6408 |
Total Skips | 1378 |
Total Code Submissions | 21816 |
Total Times Completed | 3173 |
Ruby Completions | 627 |
JavaScript Completions | 1291 |
CoffeeScript Completions | 94 |
C Completions | 462 |
Python Completions | 730 |
Total Stars | 102 |
% of votes with a positive feedback rating | 92% of 442 |
Total "Very Satisfied" Votes | 377 |
Total "Somewhat Satisfied" Votes | 55 |
Total "Not Satisfied" Votes | 10 |