Skip to content

Commit 144be8c

Browse files
refactor 1150
1 parent 30a1c5d commit 144be8c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/com/fishercoder/solutions/_1150.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
public class _1150 {
2929
public static class Solution1 {
3030
public boolean isMajorityElement(int[] nums, int target) {
31-
int left = 0;
32-
int right = nums.length - 1;
33-
int mid = left + (right - left) / 2;
34-
return nums[mid] == target;
31+
return nums[(nums.length - 1) / 2] == target;
3532
}
3633
}
3734
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy