@@ -0,0 +1,1984 @@
+import java.util.ArrayList;%0Aimport java.util.HashMap;%0A%0Apublic class Numbers%0A%7B%0A    public static void main( String%5B%5D args )%0A    %7B%0A        String data = %221,2,3,4,t,6,7,8,NEIN!,10,20,30,forty,50,60,70,a0,90,100,200,300,400,500,big-number,700,800,900,1000,%22;%0A        String%5B%5D split = data.split( %22,%22, 1000 );%0A        // have to save the original Strings since String.join() only accepts Strings%0A        ArrayList%3CString%3E numberStrings = new ArrayList%3C%3E(  );%0A        String notNumbers = %22abcdefghijklmnopqrstuvwxyz!@#$%25%5E&*()%22;%0A        HashMap%3CString, Long%3E realNumbers = new HashMap%3C%3E(  );%0A        for ( String s : split )%0A            if ( !containsAny( s, notNumbers ) )%0A                try %7B%0A                    numberStrings.add( s );%0A                    realNumbers.put( s, Long.valueOf( s ) );%0A                %7D catch ( NumberFormatException e )%7B /* i already tested if it wasn't a number; this can't happen */ %7D%0A%0A        long sum = 0;%0A        long productSum = 0;%0A        for ( int i = 0; i %3C numberStrings.size() ; ++i )%0A        %7B%0A            String currentNumberString = numberStrings.get( i );%0A            sum += realNumbers.get( currentNumberString );%0A            String nextNumberString = numberStrings.get( i + 1 );%0A            productSum += realNumbers.get( currentNumberString ) * realNumbers.get( nextNumberString );%0A        %7D%0A        System.out.println(%22Actual numbers in input: %22 + String.join( %22,%22, numberStrings ));%0A        System.out.println(%22   Sum:  %22 + sum);%0A        System.out.println(%22   Mean: %22 + sum / (double) numberStrings.size());%0A        System.out.println(%22   Sum of product of neighbors:  %22 + productSum );%0A        System.out.println(%22   mean of product of neighbors: %22 + productSum / (double) numberStrings.size() );%0A    %7D%0A%0A    public static boolean containsAny(String test, String search)%7B%0A        for ( int i=0; i%3Ctest.length(); ++i)%0A            if ( search.indexOf( test.charAt( i ) ) != -1 )%0A                return true;%0A        return false;%0A    %7D%0A%7D%0A

add another possible question