We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ddfb19 commit 94e8c61Copy full SHA for 94e8c61
Python/bitwise-or-of-adjacent-elements.py
@@ -0,0 +1,11 @@
1
+# Time: O(n)
2
+# Space: O(1)
3
+
4
+# array
5
+class Solution(object):
6
+ def orArray(self, nums):
7
+ """
8
+ :type nums: List[int]
9
+ :rtype: List[int]
10
11
+ return [nums[i]|nums[i+1] for i in range(len(nums)-1)]
0 commit comments