Question
Given an array nums sorted in non-decreasing order, and a number target, return True if and only if target is a majority element.
A majority element is an element that appears more than N/2 times in an array of length N.
Example:
Input: nums = [2,4,5,5,5,5,5,6,6], target = 5
Output: true
Solution
1 | public boolean isMajorityElement(int[] nums, int target) { |