forked from wisdompeak/LeetCode
-
Notifications
You must be signed in to change notification settings - Fork 1
[pull] master from wisdompeak:master #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jenningsloy318
merged 62 commits into
AlgorithmAndLeetCode:master
from
wisdompeak:master
May 27, 2022
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
14905de
Update Readme.md
wisdompeak bf36143
Update Readme.md
wisdompeak f4c967f
Update 732.My-Calendar-III.cpp
wisdompeak 8f0936e
Update Readme.md
wisdompeak 4f2379f
Update 253.Meeting-Rooms-II_v2.cpp
wisdompeak 6b48384
Update Readme.md
wisdompeak 0e98ccd
Update Readme.md
wisdompeak 4674eea
Create 2272.Substring-With-Largest-Variance.cpp
wisdompeak 1c66e00
Update Readme.md
wisdompeak af821e3
Create Readme.md
wisdompeak 63cba92
Update Readme.md
wisdompeak ed7bc1e
Update 493.Reverse-Pairs_v1.cpp
wisdompeak ef946d6
Create 2272.Substring-With-Largest-Variance_v2.cpp
wisdompeak c3ede06
Update Readme.md
wisdompeak e22071e
Update Readme.md
wisdompeak 91f879a
Create 2271.Maximum-White-Tiles-Covered-by-a-Carpet.cpp
wisdompeak 6ffef9d
Update Readme.md
wisdompeak 5457818
Create Readme.md
wisdompeak cc1fd3d
Create 2275.Largest-Combination-With-Bitwise-AND-Greater-Than-Zero.cpp
wisdompeak b4faf37
Update Readme.md
wisdompeak f2d87dd
Create Readme.md
wisdompeak 646a399
Create 2276.Count-Integers-in-Intervals.cpp
wisdompeak 2d20c78
Update Readme.md
wisdompeak 219555d
Update Readme.md
wisdompeak 677cff4
Update Readme.md
wisdompeak 0df9bde
Update Readme.md
wisdompeak 8c34a2b
Create Readme.md
wisdompeak 3fa97d9
Create 1893.Check-if-All-the-Integers-in-a-Range-Are-Covered.cpp
wisdompeak 5e1f37b
Update Readme.md
wisdompeak 8619c6d
Create Readme.md
wisdompeak dccf2d9
Update Readme.md
wisdompeak 0626bc0
Update 351.Android-Unlock-Patterns.cpp
wisdompeak 7b1f152
Update 2015.Average-Height-of-Buildings-in-Each-Segment.cpp
wisdompeak 91c33cf
Update Readme.md
wisdompeak cfdfb66
Update 2015.Average-Height-of-Buildings-in-Each-Segment.cpp
wisdompeak d4c4f58
Update 2158.Amount-of-New-Area-Painted-Each-Day.cpp
wisdompeak 7545bae
Update Readme.md
wisdompeak 3a30051
Create 930.Binary-Subarrays-With-Sum_v2.cpp
wisdompeak 188a295
Update Readme.md
wisdompeak 74d918a
Update Readme.md
wisdompeak 416f6d1
Update 218.The-Skyline-Problem.cpp
wisdompeak 0518651
Update Readme.md
wisdompeak bb6a000
Update Readme.md
wisdompeak 322c53c
Create 2237.Count-Positions-on-Street-With-Required-Brightness.cpp
wisdompeak 98a3d37
Update Readme.md
wisdompeak 280e09c
Create Readme.md
wisdompeak 240128f
Create 490.The-Maze.cpp
wisdompeak 9461f77
Update Readme.md
wisdompeak 1af2dae
Create Readme.md
wisdompeak fef2ba8
Create 6077.Sum-of-Total-Strength-of-Wizards.cpp
wisdompeak afcbc26
Update Readme.md
wisdompeak d7b3e14
Create Readme.md
wisdompeak cf23f97
Update Readme.md
wisdompeak 668082c
Update Readme.md
wisdompeak c84c8d2
Update and rename Others/6077.Sum-of-Total-Strength-of-Wizards/6077.S...
wisdompeak 89d0265
Rename Others/6077.Sum-of-Total-Strength-of-Wizards/Readme.md to Othe...
wisdompeak 78d4974
Update Readme.md
wisdompeak 6e82c3f
Update Readme.md
wisdompeak 6b77c0c
Update Readme.md
wisdompeak 19a16e8
Create 2280.Minimum-Lines-to-Represent-a-Line-Chart.cpp
wisdompeak 7c5183f
Update Readme.md
wisdompeak 3b50e51
Create Readme.md
wisdompeak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create 2275.Largest-Combination-With-Bitwise-AND-Greater-Than-Zero.cpp
- Loading branch information
commit cc1fd3d1b92c342d0691e822439c1d96e401ce1d
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
...ise-AND-Greater-Than-Zero/2275.Largest-Combination-With-Bitwise-AND-Greater-Than-Zero.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class Solution { | ||
public: | ||
int largestCombination(vector<int>& candidates) | ||
{ | ||
int ret = 0; | ||
for (int i=0; i<31; i++) | ||
{ | ||
int count = 0; | ||
for (int x: candidates) | ||
{ | ||
if ((x>>i)&1) | ||
count++; | ||
} | ||
ret = max(ret, count); | ||
} | ||
return ret; | ||
} | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.