Java Are Equally Strong
public class Solution {
public static boolean areEquallyStrong(int yourLeft, int yourRight, int friendsLeft, int friendsRight) {
return Math.max(yourLeft, yourRight) == Math.max(friendsLeft, friendsRight)
&& Math.min(yourLeft, yourRight) == Math.min(friendsLeft, friendsRight);
}
}
This compares each person’s strongest and weakest arm. If both pairs match, the result is true.