diff --git a/Java/Ch 10. Sorting and Searching/Q10_03_Search_in_Rotated_Array/Question.java b/Java/Ch 10. Sorting and Searching/Q10_03_Search_in_Rotated_Array/Question.java index bf7fd82ae..3facc4a79 100644 --- a/Java/Ch 10. Sorting and Searching/Q10_03_Search_in_Rotated_Array/Question.java +++ b/Java/Ch 10. Sorting and Searching/Q10_03_Search_in_Rotated_Array/Question.java @@ -32,7 +32,7 @@ public static int search(int a[], int left, int right, int x) { } else { return search(a, left, mid - 1, x); } - } else if (a[left] == a[mid]) { // Left is either all repeats OR loops around (with the right half being all dups) + } else { // Left is either all repeats OR loops around (with the right half being all dups) if (a[mid] != a[right]) { // If right half is different, search there return search(a, mid + 1, right, x); } else { // Else, we have to search both halves