This is the question:
An array chosen contains n distinct integers arranged in no particular order.
Another array winners contains m distinct integers arranged in ascending order.
Write efficient code to determine how many of the numbers in chosen appear in
winners
package worksheet6Quest25; import java.util.*; public class ArrayCompareNumbers{ public static void main (String []args){ Scanner in =new Scanner(System.in); int []chosen= {5, 8, 4, 9 ,1, 7, 0}; int []winner= {1, 4, 6, 8, 0, 3}; int m; int n; int count=0; for (m=0;m< m-1; m++) { for (n=0; n<n-1; n++) { if (chosen[n]==winner[m]) { count++; } } System.out.printf ("%d", count) ; } } }
My output is blank.