We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It is not necessary to make a separate explicit condition that prints "YES" when the size of array is equal to one.
It all depends on how a person structures the code. So, this condition could be contained implicitly within the code as a part of one general condition for checking whether the two parts are equal.
And when the size of the array is equal to one then the variables of the global condition:
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →
It is not necessary to make a separate explicit condition that prints "YES" when the size of array is equal to one. It all depends on how a person structures the code. So, this condition could be contained implicitly within the code as a part of one general condition for checking whether the two parts are equal. And when the size of the array is equal to one then the variables of the global condition:
will have values:
Here is my solution for Java: