This is my problem: Write a function commonEntries in Java that takes two stored
ID: 3613482 • Letter: T
Question
This is my problem:Write a function commonEntries in Java that takes two stored arraysof integers and returns the number of common entries in the twoarrays. For example, if A equals {1,2,4,8,10}, and B equals {2,3,4}then commonEntries(A,B) should return 2. Each of the inputarray is required to be sorted and free from duplicates. Yourfunction should flag violation of this assumption. To testyour function, write a program that reads the arrays from two filesspecified in command line arguments and outputs the number ofcommon entries. Also Assume that the numbers are separated by asingle space. Any help would be appreciated. This is my problem:
Write a function commonEntries in Java that takes two stored arraysof integers and returns the number of common entries in the twoarrays. For example, if A equals {1,2,4,8,10}, and B equals {2,3,4}then commonEntries(A,B) should return 2. Each of the inputarray is required to be sorted and free from duplicates. Yourfunction should flag violation of this assumption. To testyour function, write a program that reads the arrays from two filesspecified in command line arguments and outputs the number ofcommon entries. Also Assume that the numbers are separated by asingle space. Any help would be appreciated.