public static int bruteForceBackup(String pattern, String docs) {
		int i, N = docs.length();
		int j, M = pattern.length();
		
		for (i = 0, j = 0; i < N && j < M; i++) 
			if (docs.charAt(i + j) == pattern.charAt(j)) j++;
			else { i -= j; j = 0; }
		
		if (j == M) return i - M;
		else return N;
	}