Problem
How can I convert this function definition for counting the number of occurrences of a given substring in a given string to a English written algorithm?
• Function: count substrings
• Inputs: main string, a string, substring, a string
• Preconditions: main string is a non-zero length string; substring is a non-zero length string at maximum the same length as main string
• Output: count, an integer
• Postconditions: count is the number of occurrences of substring within main string