Tap here to switch tabs
Problem
Submissions

Problem: Largest Multiple of Three

med
30 min
Try to solve the Largest Multiple of Three problem.

Statement

Given an array of integers digits, return the largest possible multiple of 33 that can be formed by concatenating a subset of the given digits in any arrangement.

Return the result as a string. If no multiple of 33 can be formed, return an empty string. The returned number must not contain leading zeros unless the value is 00 itself.

Constraints:

  • 1≤1 \leq digits.length ≤104\leq 10^4

  • 0≤0 \leq digits[i] ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest Multiple of Three

med
30 min
Try to solve the Largest Multiple of Three problem.

Statement

Given an array of integers digits, return the largest possible multiple of 33 that can be formed by concatenating a subset of the given digits in any arrangement.

Return the result as a string. If no multiple of 33 can be formed, return an empty string. The returned number must not contain leading zeros unless the value is 00 itself.

Constraints:

  • 1≤1 \leq digits.length ≤104\leq 10^4

  • 0≤0 \leq digits[i] ≤9\leq 9