src/Recursion/recursion3.java
public static int countHi(String str, int i, int count) {
		if (i == str.length() - 1)
			return count;

		if (str.charAt(i) == 'h' && str.charAt(i + 1) == 'i') {
			count = count + 1;
		}

		return countHi(str, i + 1, count);

	}
//	count the number of times a word appears in a string
count the number of times a word appears in a string
count the number of times a word appears in a string
public static int countHi(String str, int i, int count) {
		if (i == str.length() - 1)
			return count;
		if (str.charAt(i) == 'h' && str.charAt(i + 1) == 'i') {
			count = count + 1;
		}
		return countHi(str, i + 1, count);
	}
public static int countHi ( String str , int i , int count ) { if ( i == str . length ( ) - 1 ) return count ; if ( str . charAt ( i ) == 'h' && str . charAt ( i + 1 ) == 'i' ) { count = count + 1 ; } return countHi ( str , i + 1 , count ) ; }
count the number of times a word appears in a string
count the number of times a word appears in a string