2020-11-02
2020-11-03
2020-11-04
2020-11-05
2020-11-09
2020-11-10
2020-11-11
2020-11-12
2020-11-13
2020-11-16
附加题:1000个6位长度的纯数字验证码,数组形式输出(最简单的方法来做)
2020-11-17
附加题:给你两个单词word1和word2,计算将word1转为word2所使用的最少操作数。你可以对一个单词进行如下三种操作:插入一个字符、删除一个字符、替换一个字符
2020-11-18
分数到小数 LeetCode
2020-11-20
Semantic Versioning 是一个前端通用的版本规范。格式为“{MAJOR}.{MINOR}.{PATCH}-{alpha|beta|rc}.{number}”,
要求实现 compare(a, b) 方法,比较 a, b 两个版本大小,
1. 当 a > b 是返回 1;
2. 当 a = b 是返回 0;
3. 当 a < b 是返回 -1;
4. 其中,rc > beta > alpha,major > minor > patch;
5. 例子,1.2.3 < 1.2.4 < 1.3.0-alpha.1 < 1.3.0-alpha.2 < 1.3.0-beta.1 < 1.3.0-rc.1 < 1.3.0
2020-11-23
在无限的整数序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …中找到第 n 个数字。
注意:
n 是正数且在32为整形范围内 ( n < 231)。
示例 1:
输入:
3
输出:
3
示例 2:
输入:
11
输出:
0
说明:
第11个数字在序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, … 里是0,它是10的一部分。
2020-11-24
2020-11-25
2020-11-26
2020-11-30
附加题 用css实现开关样式
https://mp.weixin.qq.com/s/cKsdU_BlRGyF9d8THMA06A
<input class="ios-switch" type="checkbox">
<style>
.btn {
border-radius: 31px;
width: 102px;
height: 62px;
background-color: #e9e9eb;
}
.ios-switch {
position: relative;
appearance: none;
cursor: pointer;
transition: all 100ms;
@extend .btn;
&::before {
position: absolute;
content: "";
transition: all 300ms cubic-bezier(.45, 1, .4, 1);
@extend .btn;
}
&::after {
position: absolute;
left: 4px;
top: 4px;
border-radius: 27px;
width: 54px;
height: 54px;
background-color: #fff;
box-shadow: 1px 1px 5px rgba(#000, .3);
content: "";
transition: all 300ms cubic-bezier(.4, .4, .25, 1.35);
}
&:checked {
background-color: #5eb662;
&::before {
transform: scale(0);
}
&::after {
transform: translateX(40px);
}
}
}
</style>
完整demo:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<style>
.btn {
border-radius: 31px;
width: 102px;
height: 62px;
background-color: #e9e9eb;
}
.ios-switch {
position: relative;
appearance: none;
cursor: pointer;
transition: all 100ms;
border-radius: 31px;
width: 102px;
height: 62px;
background-color: #e9e9eb;
}
.ios-switch::before {
position: absolute;
content: '';
transition: all 300ms cubic-bezier(0.45, 1, 0.4, 1);
border-radius: 31px;
width: 102px;
height: 62px;
background-color: #e9e9eb;
}
.ios-switch::after {
position: absolute;
left: 4px;
top: 4px;
border-radius: 27px;
width: 54px;
height: 54px;
background-color: #fff;
box-shadow: 1px 1px 5px rgba(#000, 0.3);
content: '';
transition: all 300ms cubic-bezier(0.4, 0.4, 0.25, 1.35);
}
.ios-switch:checked {
background-color: #5eb662;
}
.ios-switch:checked::before {
transform: scale(0);
}
.ios-switch:checked::after {
transform: translateX(40px);
}
</style>
<body>
<input class="ios-switch" type="checkbox" />
</body>
</html>