1 Star 0 Fork 0

张志光/Leetcode-js

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
389.找不同.html 618 Bytes
Copy Edit Raw Blame History
zhangzhiguang123 authored 2019-09-16 19:34 . 力扣
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
var findTheDifference = function(s, t) {
let sArr = s.split("").sort();
let tArr = t.split("").sort();
// console.log(sArr,tArr);
for(let i=0;i<t.length;i++){
if(sArr[i]!==tArr[i]) return tArr[i];
}
};
findTheDifference("aacd","abcde");
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/guangzz/Leetcode-js.git
git@gitee.com:guangzz/Leetcode-js.git
guangzz
Leetcode-js
Leetcode-js
master

Search