1
0

2 Ревизии 0ac0c7a7a7 ... 1f86e203aa

Автор SHA1 Съобщение Дата
  ixueaedu 1f86e203aa update преди 2 години
  ixueaedu 0033b89ce3 update преди 2 години
променени са 5 файла, в които са добавени 23 реда и са изтрити 0 реда
  1. BIN
      __pycache__/merge_two_lists.cpython-39-pytest-7.1.1.pyc
  2. BIN
      __pycache__/merge_two_lists.cpython-39.pyc
  3. 11 0
      array/single_Number.py
  4. 7 0
      draft.py
  5. 5 0
      generat_matrix.py

BIN
__pycache__/merge_two_lists.cpython-39-pytest-7.1.1.pyc


BIN
__pycache__/merge_two_lists.cpython-39.pyc


+ 11 - 0
array/single_Number.py

@@ -0,0 +1,11 @@
+from typing import List
+
+# 异或运算有以下三个性质。
+# 任何数和 00 做异或运算,结果仍然是原来的数,即 a ⊕ 0=a。
+# 任何数和其自身做异或运算,结果是 00,即 a ⊕ a = 0。
+# 异或运算满足交换律和结合律
+def singleNumber(self, nums: List[int]) -> int:
+    arr = 0
+    for i in nums:
+        arr ^= i
+    return arr

+ 7 - 0
draft.py

@@ -1,4 +1,11 @@
+<<<<<<< HEAD
+import numpy as np
+n = 3
+m = np.array(range(1, (n * n) + 1)).reshape(n, n)
+print(m)
+=======
 s = "A man, a plan, a canal: Panama".lower()
 b = ''.join(ch for ch in s if ch.isalnum()).lower()
 print(b)
 
+>>>>>>> 0ac0c7a7a7ace7b2c81857019fe6ed8ad32cad09

+ 5 - 0
generat_matrix.py

@@ -0,0 +1,5 @@
+from typing import List
+import numpy as np
+
+def generateMatrix(self, n: int) -> List[List[int]]:
+    m = np.array(range(1, (n * n) + 1)).reshape(n, n)