5 kyu
Return substring instance count - 2
631 of 3,243ineiti
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 | 6510 |
Total Skips | 1383 |
Total Code Submissions | 22167 |
Total Times Completed | 3243 |
Ruby Completions | 631 |
JavaScript Completions | 1323 |
CoffeeScript Completions | 94 |
C Completions | 475 |
Python Completions | 760 |
Total Stars | 104 |
% of votes with a positive feedback rating | 91% of 453 |
Total "Very Satisfied" Votes | 384 |
Total "Somewhat Satisfied" Votes | 58 |
Total "Not Satisfied" Votes | 11 |