#521 Minimum Difference Between Two Arrays
Find the minimum absolute difference between any two elements from different arrays:
arr1 = [1, 20, 11, 15]
arr2 = [22, 16, 7]
Minimum difference: |15 - 16| = 1
int minAbsDiff(int[] arr1, int[] arr2) {
...
}
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor