2020-11-02

image.png

2020-11-03

image.png

2020-11-04

image.png

2020-11-05

image.png

2020-11-09

image.png

2020-11-10

image.png

2020-11-11

image.png

2020-11-12

image.png

2020-11-13

image.png

2020-11-16

image.png
附加题:1000个6位长度的纯数字验证码,数组形式输出(最简单的方法来做)
image.png
image.png
image.png

2020-11-17

image.png
附加题:给你两个单词word1和word2,计算将word1转为word2所使用的最少操作数。你可以对一个单词进行如下三种操作:插入一个字符、删除一个字符、替换一个字符
image.png
image.png

2020-11-18

image.png
分数到小数 LeetCode

2020-11-20

image.png
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
image.png
image.png

2020-11-23

image.png
在无限的整数序列 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的一部分。
image.png
image.png
image.png

2020-11-24

image.png

2020-11-25

image.png

2020-11-26

巴什博奕,n%(m+1)!=0 ;n为总数 m为最多个数
image.png

2020-11-30

image.png
附加题 用css实现开关样式
https://mp.weixin.qq.com/s/cKsdU_BlRGyF9d8THMA06A

  1. <input class="ios-switch" type="checkbox">
  2. <style>
  3. .btn {
  4. border-radius: 31px;
  5. width: 102px;
  6. height: 62px;
  7. background-color: #e9e9eb;
  8. }
  9. .ios-switch {
  10. position: relative;
  11. appearance: none;
  12. cursor: pointer;
  13. transition: all 100ms;
  14. @extend .btn;
  15. &::before {
  16. position: absolute;
  17. content: "";
  18. transition: all 300ms cubic-bezier(.45, 1, .4, 1);
  19. @extend .btn;
  20. }
  21. &::after {
  22. position: absolute;
  23. left: 4px;
  24. top: 4px;
  25. border-radius: 27px;
  26. width: 54px;
  27. height: 54px;
  28. background-color: #fff;
  29. box-shadow: 1px 1px 5px rgba(#000, .3);
  30. content: "";
  31. transition: all 300ms cubic-bezier(.4, .4, .25, 1.35);
  32. }
  33. &:checked {
  34. background-color: #5eb662;
  35. &::before {
  36. transform: scale(0);
  37. }
  38. &::after {
  39. transform: translateX(40px);
  40. }
  41. }
  42. }
  43. </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>

image.pngimage.png