Tap here to switch tabs
Problem
Submissions

Problem: Maximum Subarray Sum With Length Divisible by K

Try to solve the Maximum Subarray Sum With Length Divisible by K problem.

Statement

Given an integer array nums and an integer k, find the maximum sum of a non empty subarray of nums such that the length of the subarray is divisible by k.

Note: A subarray is a contiguous sequence of elements within an array.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤2×105\leq 2 \times 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Subarray Sum With Length Divisible by K

Try to solve the Maximum Subarray Sum With Length Divisible by K problem.

Statement

Given an integer array nums and an integer k, find the maximum sum of a non empty subarray of nums such that the length of the subarray is divisible by k.

Note: A subarray is a contiguous sequence of elements within an array.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤2×105\leq 2 \times 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9