<filename>1101-1200/1150.check-if-a-number-is-majority-element-in-a-sorted-array.py<gh_stars>0
#
# @lc app=leetcode id=1150 lang=python3
#
# [1150] Check If a Number Is Majority Element in a Sorted Array
#

# @lc code=start
import bisect as bs

class Solution:
    def isMajorityElement(self, nums: List[int], target: int) -> bool:
        return (
            bs.bisect(nums, target) - bs.bisect_left(nums, target)
            > len(nums) // 2
        )
# @lc code=end

<filename>1101-1200/1150.check-if-a-number-is-majority-element-in-a-sorted-array.py<gh_stars>0
#
# @lc app=leetcode id=1150 lang=python3
#
# [1150] Check If a Number Is Majority Element in a Sorted Array
#

# @lc code=start
import bisect as bs

class Solution:
    def isMajorityElement(self, nums: List[int], target: int) -> bool:
        return (
            bs.bisect(nums, target) - bs.bisect_left(nums, target)
            > len(nums) // 2
        )
# @lc code=end

# # @lc app=leetcode id=1150 lang=python3 # # [1150] Check If a Number Is Majority Element in a Sorted Array # # @lc code=start # @lc code=end