Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sum of Three Numbers Divisible by Three

Maximum Sum of Three Numbers Divisible by Three asks you to choose three distinct array elements with the largest possible sum divisible by three, or return zero when no valid triplet exists.

Statement

Given an integer array nums, determine the maximum sum of three distinct elements from nums such that their sum is divisible by 33. If no such triplet exists, return 00.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sum of Three Numbers Divisible by Three

Maximum Sum of Three Numbers Divisible by Three asks you to choose three distinct array elements with the largest possible sum divisible by three, or return zero when no valid triplet exists.

Statement

Given an integer array nums, determine the maximum sum of three distinct elements from nums such that their sum is divisible by 33. If no such triplet exists, return 00.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5