Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
A number is a multiple of three if and only if its sum of digits is a multiple of three.
Use dynamic programming.
To find the maximum number, try to maximize the number of digits of the number.
Sort the digits in descending order to find the maximum number.