Question: In this question, there is a class called Challenge with a static method called hasPair . This accepts a single array of strings as a
In this question, there is a class called Challenge with a static method called hasPair. This accepts a single array of strings as a parameter and returns a boolean.
What is the code that will return true if the array contains two elements that are the same (i.e., a pair) and false if it does not, and I can't use any of the loop constructs for this question.

\begin{tabular}{l|l} 1 & public class Challenge \\ 2 & \{ \\ 3 & public static boolean hasPair(String[] list) \\ 4 & \{ \\ 5 & // implement your code here \\ 6 & \} \\ 7 & \} \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
