5
void calculate(vector<int> &count, int no, vector<int> &temp) {7
int flag = 0, sum1 = 0, sum2 = 0, validSum = 0;8
for (int j = 1; j < 10; j++) {11
validSum += (temp[j] * j);13
if (validSum % 3 != 0) {19
else if (sum1 > sum2) {20
for (int i = 1; i < 10; i++) {27
if (ans[j] < temp[j]) {30
} else if (ans[j] > temp[j])35
for (int i = 1; i < 10; i++) {42
int targetCount = count[no] - 2;44
if (targetCount < 0) targetCount = 0;51
calculate(count, no - 1, temp);54
} while (co >= targetCount);57
string largestMultipleOfThree(vector<int> &digits) {58
vector<int> count(10, 0);59
int n = digits.size();60
for (int i = 0; i < n; i++) {63
vector<int> temp(10, 0);65
calculate(count, 9, temp);69
for (int i = 9; i >= 0; i--) {70
for (int j = 1; j <= ans[i]; j++) {74
if (res.size() >= 2 && res[0] == '0' && res[1] == '0') return "0";