package ru.nivanov;

public class SubOrigin {
	
	boolean contains(String origin, String sub) {
		
		char[]chOrig = origin.toCharArray();
		char[]chSub = sub.toCharArray();
		
		int index = 0;
		int count = 0;
		boolean result = false;
				
		for (int j = 0; j < chSub.length; j++) {
			
			for (int i = index; i < chOrig.length; i++) {
				if (chSub[j]==chOrig[i]) {
					index = i + 1;
					count ++;
					break;
				} 
				else {
					count = 0;
				}
										
			}
					
		}
		
		if (count == chSub.length) {
			result = true;
		} else 
			result = false;
		
		return result;
		
	}

}
@@ -347,16 +347,17 @@
 Sub%5Bj%5D==
+(
 chOrig%5Bi
@@ -358,16 +358,17 @@
 Orig%5Bi%5D)
+)
  %7B%0A%09%09%09%09%09
@@ -419,25 +419,15 @@
 %09%09%7D 
-%0A%09%09%09%09
 else %7B
-%0A%09%09%09%09%09
+ 
 coun
@@ -437,16 +437,18 @@
  0;%0A%09%09%09%09
+  
 %7D%0A%09%09%09%09%09%09
@@ -476,21 +476,22 @@
 %09%0A%09%09
-if (
+return 
 count
- 
 ==
- 
 chSu
@@ -502,77 +502,8 @@
 ngth
-) %7B%0A%09%09%09result = true;%0A%09%09%7D else %0A%09%09%09result = false;%0A%09%09%0A%09%09return result
 ;%0A%09%09

add correct test task SubOrigin