package eu.ge0;

/**
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}

@@ -14,19 +14,8 @@
 0;%0A%0A
-/**%0A *%0A */%0A
 publ
@@ -31,29 +31,29 @@
 App 
-%0A
 %7B%0A    p
-ublic
+rivate
  static 
 void
@@ -52,85 +52,998 @@
 tic 
-void main( String%5B%5D args )%0A    %7B%0A        System.out.println( %22Hello World!%22 )
+final int NOT_FOUND = Integer.MIN_VALUE;%0A%0A    /**%0A     * Given two arrays, will find the starting position of the second array in the first array.%0A     */%0A    public static int findPosition(int%5B%5D haystack, int%5B%5D needle) %7B%0A        if (needle.length == 0) return NOT_FOUND;%0A%0A        int position = NOT_FOUND;%0A        for (int i = 0; i %3C haystack.length; i++) %7B%0A            int remaining = haystack.length - i;%0A            if (needle.length %3E remaining) break; // needle is currently larger than haystack%0A%0A            if (needle%5B0%5D == haystack%5Bi%5D) %7B // found initial hook%0A                position = i;%0A                for (int j = 1; j %3C needle.length; j++) %7B // can save one iteration%0A                    int haystackPosition = i+j;%0A                    if (needle%5Bj%5D != haystack%5BhaystackPosition%5D) %7B // needle has discontinued%0A                        position = NOT_FOUND;%0A                        break;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A        return position
 ;%0A  

find needle in haystack