We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8031e71 commit 4ec6971Copy full SHA for 4ec6971
1486.数组异或操作/1486-数组异或操作.py
@@ -0,0 +1,11 @@
1
+class Solution(object):
2
+ def xorOperation(self, n, start):
3
+ """
4
+ :type n: int
5
+ :type start: int
6
+ :rtype: int
7
8
+ res = start
9
+ for i in range(1, n):
10
+ res ^= start + 2 * i
11
+ return res
1528.重新排列字符串/1528-重新排列字符串.py
+ def restoreString(self, s, indices):
+ :type s: str
+ :type indices: List[int]
+ :rtype: str
+ res = ["" for _ in indices]
+ for i in range(len(s)):
+ res[indices[i]] = s[i]
+ return "".join(ch for ch in res)
0 commit comments