• + 0 comments

    Only 2 test cases (0,4)are passing all other are failing , can't think where is it going wrong public static int solve(Stack f,Stack s,int len , int cs,int max){ int n = f.peek()>=s.peek()?s.peek():f.peek(); // System.out.println(f.peek()); // System.out.println(s.peek()); // System.out.println("n:"+n); if(cs+n a, List b) { // Write your code here Stack first = new Stack<>(); for(int i =a.size()-1;i>=0;i--){ first.push(a.get(i)); } // System.out.println;

    Stack<Integer> Second = new Stack<>();
    for(int i =b.size()-1;i>=0;i--){
        Second.push(b.get(i));
    }
    int len = 0;
    int currsumm = 0;
    return solve(first,Second,len,currsumm,maxSum);
    
    }
    

    }