
/*
Online Java - IDE, Code Editor, Compiler

Online Java is a quick and easy tool that helps you to build, compile, test your programs online.
*/

import java.util.function.Predicate;
import java.util.*;

public class Main
{
    
    
    public static void main(String[] args) {
        System.out.println("Welcome to Online IDE!! Happy Coding :)");
        
        Set <String> st = new HashSet<String>();
        
        //imagine this is the data added first time around (as per document)
        //this would be stored as an offset of completing C(5,5)
        //it can be seen following.
        //Note I am adding data with the conventional { that would be associated with
        //declaring 3D array. This is for readability.
        //It can be managed via StringJoiner
        
            //subset    //sum  //total-subset  
        st.add("{ {10},  {10}, {65} }");
        st.add("{ {10,15},  {25}, {50} }");
        st.add("{10,15,20},  {45}, {30} }");
        st.add("{ {10,15,20,25},  {65}, {10} }");
        st.add("{ {10,15,20,25,5},  {65}, {10} }");
        
        //if the following set entry was derived subsequently
       // number = {10,15,25,20,5}
        //I would perform a lookup to check if:
        
        String numbers = "{ {10,15,25,20,5}";
        
        Predicate<String> filtertest = x ->x.startsWith(numbers);
        st.stream().filter(t -> filtertest.test(t)).forEach(System.out::println);
        
        
        if ((filtertest.test(numbers)))
        {
            System.out.println("Found in set:\n");
            
        }
        
        
    }
}
