top of page

Looking to master object-oriented and system design for tech interviews or career growth?

  • Improve your system design and machine coding skills.

  • Study with our helpful resources.

  • Prepare for technical interviews and advance your career.

**We're in beta mode and would love to hear your feedback.

1 comentário

Devesh Dhote
Devesh Dhote
20 de jan. de 2022

string Solution::largestNumber(const vector<int> &A) { vector<string> arr; int i,j,k, size=A.size(); for(i=0;i<size;i++){ arr.push_back(to_string(A[i])); } for(i=0;i<size-1;i++){ for(j=i;j<size;j++){ int s1 = arr[i].size(); int s2 = arr[j].size(); int itr = s1>s2 ? s1 : s2; for(k=0 ; k<itr ; k++){ if(arr[i][k%s1] > arr[j][k%s2]){ break; } if(arr[i][k%s1] < arr[j][k%s2]){ swap(arr[i],arr[j]); break; } } } } string ans; for(i=0;i<size;i++){ ans=ans+arr[i]; } if(ans[0]=='0'){return "0";} return ans; }

bottom of page