//============================================================================
// Name : reversestring.cpp
// Author : qxyu
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
#include<stack>
#include<string>
#include<unordered_map>
#include<memory>
//#include<uint32_t>
using namespace std;
/**
* Definition for a point.
*/
struct Treenode{
Treenode* left;
Treenode* right;
int val;
Treenode(int x):left(NULL),right(NULL),val(x){}
};
void ArraytoMin(vector<int> arr){
if(arr.size()==0) return;
int length=arr.size();
//char** str=(char**)malloc(sizeof(arr.size());
char** str = string* (new int[length]);
for(int i = 0; i < arr.size(); i ++){
sprintf(str[i],"%d",arr[i]);
}
sort(str,length,sizeof(char*),compare);
for(int i = 0; i < arr.size(); i ++){
cout<<str[i];
}
}
char* com1=new char[20];
char* com2=new char[20];
int compare(const char* str1, const char* str2){
strcpy(com1,str1);
strcat(com1,str2);
strcpy(com2,str2);
strcat(com2,str1);
return strcmp(com1,com2);
}
// Name : reversestring.cpp
// Author : qxyu
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
#include<stack>
#include<string>
#include<unordered_map>
#include<memory>
//#include<uint32_t>
using namespace std;
/**
* Definition for a point.
*/
struct Treenode{
Treenode* left;
Treenode* right;
int val;
Treenode(int x):left(NULL),right(NULL),val(x){}
};
void ArraytoMin(vector<int> arr){
if(arr.size()==0) return;
int length=arr.size();
//char** str=(char**)malloc(sizeof(arr.size());
char** str = string* (new int[length]);
for(int i = 0; i < arr.size(); i ++){
sprintf(str[i],"%d",arr[i]);
}
sort(str,length,sizeof(char*),compare);
for(int i = 0; i < arr.size(); i ++){
cout<<str[i];
}
}
char* com1=new char[20];
char* com2=new char[20];
int compare(const char* str1, const char* str2){
strcpy(com1,str1);
strcat(com1,str2);
strcpy(com2,str2);
strcat(com2,str1);
return strcmp(com1,com2);
}