Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 385 Bytes

Largest Number formed from array.md

File metadata and controls

15 lines (12 loc) · 385 Bytes
	static bool cmp(string& a, string& b){
	    return (a+b>b+a);
	}
	
	string printLargest(int n, vector<string> &arr) {
	    sort(arr.begin(), arr.end(), cmp);
	    string ans="";
	    for(int i=0;i<n;i++)ans+=arr[i];
	    return ans;
	}