본문 바로가기
python-algorithm

leetcode 3046. Split the Array

by 무적김두칠 2024. 4. 22.

https://leetcode.com/problems/split-the-array/description/

 

1
2
3
4
5
6
7
8
class Solution:
    def isPossibleToSplit(self, nums: List[int]) -> bool:
        set_nums = list(set(nums))
        for num in set_nums:
            if nums.count(num) >= 3:
                return False
        
        return True
cs
반응형

댓글