Skip to main content
  1. LeetCode/

LeetCode 3512: Minimum Operations to Make Array Sum Divisible by K

·1 min· ·
LeetCode Blog Bi-Weekly Easy
Wei Yi Chung
Author
Wei Yi Chung
Working at the contributing of open source, distributed systems, and data engineering.
Table of Contents
LeetCode Bi-Weekly Contest 154 - This article is part of a series.
Part 1: This Article

Meta Data
#

Difficulty: easy First Attempt: 2025-04-12

  • Total time: 01:00.00

Intuition
#

The problem need to count the minimum operations to make the array sum can de divided by K, thus we just need to find how many count we should do, means to get the reminder of nums and k

Approach
#

class Solution:
    def minOperations(self, nums: List[int], k: int) -> int:
        return sum(nums)%k

Findings
#

NA

Encountered Problems
#

NA

LeetCode Bi-Weekly Contest 154 - This article is part of a series.
Part 1: This Article

Related

LeetCode 3513: Number of Unique XOR Triplets I
·2 mins
LeetCode Blog Bi-Weekly Medium Unsolved
LeetCode Problem Solving
LeetCode 2843: Count Symmetric Integers
·1 min
LeetCode Blog Daily Easy
LeetCode Problem Solving
LeetCode 617: Merge Two Binary Trees
·2 mins
LeetCode Blog Daily Easy
LeetCode Problem Solving
LeetCode 2999: Count the Number of Powerful Integers
·2 mins
LeetCode Blog Daily Hard
LeetCode Problem Solving
LeetCode 3375: Minimum Operations to Make Array Values Equal to K
·2 mins
LeetCode Blog Daily
LeetCode Problem Solving
2022Q4 New Grad Data缺求職紀錄
·3 mins
Interview Blog
2024下半年面試經驗整理