Language: Java

import java.util.*;
 
public class Main {
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
        int[] A = new int[N];
      	int[] B = new int[N];
        int Asum = 0;
        int Bsum = 0;
        int sum = 0;
        int cntdif = 0;
        for(int i=0;i<N;i++){
        	A[i] = sc.nextInt();
            Asum += A[i];
        }
      	for(int i=0;i<N;i++){
        	B[i] = sc.nextInt();
          	Bsum += B[i];
        }
      
      	if(Asum < Bsum){
        	System.out.println(0);
        }else{
          	ArrayList<Integer> bigger = new ArrayList<Intger>();
        	for(int j=0;j<N;j++){
            	if(A[j]-B[j] <0){
                	difsum += A[j]-B[j];
                    cnt++;
                }else if(A[j]-B[j] > 0){
                 	bigger.add(A[j]-B[j]);
                }
            }
          	int big[] = bigger.toArray(new int[bigger.size()]);
          	int temp;
        	for(int k = 0; k < big.length; k++){
            	for(int l = 0; l< big.length -k-1; l++){
                	if(big[l] > big[l + 1]){
                    	temp = big[l];
                    	big[l] = big[l + 1];
                    	big[l + 1] = temp;
                	}
            	}
        	}
            int m =0;
          	while(difsum <= 0){
            	difsum += big[m];
              	m++;
                cnt++;
            }
        }
     System.out.println(cnt);    	
     } 
}  


Compiler output:
Main.java:25: error: cannot find symbol
          	ArrayList<Integer> bigger = new ArrayList<Intger>();
          	                                          ^
  symbol:   class Intger
  location: class Main
Main.java:28: error: cannot find symbol
                	difsum += A[j]-B[j];
                	^
  symbol:   variable difsum
  location: class Main
Main.java:29: error: cannot find symbol
                    cnt++;
                    ^
  symbol:   variable cnt
  location: class Main
Main.java:34: error: no suitable method found for toArray(int[])
          	int big[] = bigger.toArray(new int[bigger.size()]);
          	                  ^
    method Collection.<T#1>toArray(IntFunction<T#1[]>) is not applicable
      (cannot infer type-variable(s) T#1
        (argument mismatch; int[] cannot be converted to IntFunction<T#1[]>))
    method ArrayList.<T#2>toArray(T#2[]) is not applicable
      (inference variable T#2 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>toArray(IntFunction<T#1[]>)
    T#2 extends Object declared in method <T#2>toArray(T#2[])
Main.java:46: error: cannot find symbol
          	while(difsum <= 0){
          	      ^
  symbol:   variable difsum
  location: class Main
Main.java:47: error: cannot find symbol
            	difsum += big[m];
            	^
  symbol:   variable difsum
  location: class Main
Main.java:49: error: cannot find symbol
                cnt++;
                ^
  symbol:   variable cnt
  location: class Main
Main.java:52: error: cannot find symbol
     System.out.println(cnt);    	
                        ^
  symbol:   variable cnt
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
8 errors