Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a method max_of_both that takes two arrays of positive integers as arguments and returns the maximum integer found in both arrays. If no duplicates
Write a method max_of_both that takes two arrays of positive integers as arguments and returns the maximum integer found in both arrays. If no duplicates are found it returns the smallest possible integer (e.g., furthest from 0 in the negative direction). Here are example cases: [2,4,6,8,10,12,14] [7,7,5,4] => 4 Returned 4 because both arrays have 4. Other numbers are bigger but are not in both arrays. [2,4,6,8] [3,5,7] => -2147483648 Returned the smallest integer because no numbers are in both arrays. [7,6,22,4,4] [4,5,5,25,6] => 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started