Talk:Count occurrences of a substring: Difference between revisions

m
capitalized "bif".
m (capitalized "bif".)
 
(3 intermediate revisions by 3 users not shown)
Line 10:
 
:: That exercise aside, I just thought the task should be worded so that any given input would produce an unambiguous result. --[[User:Ledrug|Ledrug]] 17:45, 16 June 2011 (UTC)
:::For completeness' sake (and because it wouldn't affect the existing examples), I added that clarification and referenced this proof. --[[User:Mwn3d|Mwn3d]] 17:52, 16 June 2011 (UTC)
 
Yes, the problem is stated ambiguously and was probably inspired by some particular language's implementation of a built in function. It would be more appropriate to count all occurrences of a substring. Counting the maximum number of non-overlapping substrings can turn into a very complicated problem requiring backtracking.
 
: Yes, some languages' BIF may treat it as caseless, still others may treat all whitespace equally (as blank or blanks). It would've been interesting to make a case-sensative and a caseless version. The whitespace issue can be more complicated. -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:33, 12 June 2012 (UTC)