Tap here to switch tabs
Problem
Submissions

Problem: Largest Multiple of Three

Largest Multiple of Three asks you to arrange a subset of an integer array's digits into the largest possible multiple of three, returned as a string without leading zeros, or an empty string if none exists.

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

Largest Multiple of Three asks you to arrange a subset of an integer array's digits into the largest possible multiple of three, returned as a string without leading zeros, or an empty string if none exists.

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