رشته accept
پنجشنبه, ۱ آبان ۱۳۹۹، ۰۸:۱۴ ب.ظ
public class RepeatInString {
	public int StringInString(String one, String two) {
		if(one==null || two==null)
			return 0;
				if(one.isEmpty() || two.isEmpty())
					return 0;
	
		int cnt=0;
         for(int i=0;i+two.length()<=one.length();i++)
         {
        	 if(one.substring(i, i+two.length()).equals(two))
        		 cnt++;
         }
//         if(one.substring(i,Math.min( i+two.length(),one.length())).equals(two))
         return cnt;
	}
}
۹۹/۰۸/۰۱
