字符串查找字符出现次数
Description:
描述:
It's a popular interview question based of dynamic programming which has been already featured in Accolite, Amazon.
这是一个流行的基于动态编程的面试问题,已经在亚马逊的Accolite中得到了体现。
Problem statement:
问题陈述:
Given two strings S and T, find the number of times the second string occurs in the first string, whether continuous or discontinuous as subsequence.
给定两个字符串S和T ,找出第二个字符串在第一个字符串中出现的次数,无论是连续的还是不连续的作为子序列。
Input:
String S: "iloveincludehelp"
String T: "il"
Output:
5
Explanation:
说明:
The first string is,
第一个字符串是
The second string is "il"
第二个字符串是“ il”
First occurrence:
第一次出现:
Second occurrence:
第二次出现: