-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegerToRomon.cpp
More file actions
30 lines (28 loc) · 973 Bytes
/
IntegerToRomon.cpp
File metadata and controls
30 lines (28 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<<<<<<< HEAD
string prefix="";
if(strs.size()==0) return prefix;
/** check char by char, for each char, check all the string word **/
for(int k=0; k<strs[0].size(); k++){
int i=1;
for(; i<strs.size() && strs[i].size()>k; i++){
if(strs[i][k]!=strs[0][k])
return prefix;
}
if(i==strs.size()) prefix+=strs[0][k];
}
return prefix;
=======
string prefix="";
if(strs.size()==0) return prefix;
/** check char by char, for each char, check all the string word **/
for(int k=0; k<strs[0].size(); k++){
int i=1;
for(; i<strs.size() && strs[i].size()>k; i++){
if(strs[i][k]!=strs[0][k])
return prefix;
}
if(i==strs.size()) prefix+=strs[0][k];
}
return prefix;
>>>>>>> cecf2dfa9be01e64d36f8544e18268381542c885
}