Problem

Return how many times sub appears in s (non-overlap).

Examples

  • countSubstring("aaaa", "aa") -> 2
Compile and test (Ctrl+Enter)