function longestSubStrLength(str1, str2) {
str1 = str1.toLowerCase();
str2 = str2.toLowerCase();
var S = ""
if (str1.length > str2.length) {
[str1, str2] = [str2, str1]
}
for (var j = str1.length; j > 0; j--)
for (var i = 0; i <= str1.length - j; i++) {
S = str1.substr(i, j);
if (str2.indexOf(S) >= 0) return S.length;
}
return 0;
}
function sortVersion(s1, s2) {
var sources = s1.split('.');
var dests = s2.split('.');
var maxL = Math.max(sources.length, dests.length);
var result = [];
for (let i = 0; i < maxL; i++) {
let preValue = sources.length>i ? sources[i]:0;
let preNum = isNaN(Number(preValue)) ? preValue.charCodeAt() : Number(preValue);
let lastValue = dests.length>i ? dests[i]:0;
let lastNum = isNaN(Number(lastValue)) ? lastValue.charCodeAt() : Number(lastValue);
if (preNum < lastNum) {
result.push(s1);
result.push(s2)
break;
} else if (preNum > lastNum) {
result.push(s2);
result.push(s1)
break;
}
}
return result;
}