Skip to content

Commit 50a9545

Browse files
committed
2044
1 parent 3a0f57f commit 50a9545

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Oct-18-24.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def countMaxOrSubsets(self, nums: List[int]) -> int:
3+
def bt(i=0,val=0):
4+
nonlocal maX,ans
5+
if val==maX:
6+
ans += 1
7+
for i in range(i,len(nums)):
8+
bt(i+1,val|nums[i])
9+
maX = 0
10+
ans =0
11+
for i in nums:
12+
maX |= i
13+
bt()
14+
return ans

0 commit comments

Comments
 (0)