forked from wisdompeak/LeetCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4125d0
commit 45373a0
Showing
1 changed file
with
7 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...n/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters/Readme.md
This file contains 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,7 @@ | ||
### 1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters | ||
|
||
本题就是一个基本的DFS爆搜。注意不要误认为是LIS。 | ||
|
||
一个long long变量有32个bit,我们可以用来记录dfs的过程中已经收集了哪些字符,记做变量bits。当前DFS过程中的bits与某个新字符串对应的bits做“AND”之后,如果不为零时,说明二者有重复的字符,搜索可以终止。 | ||
|
||
最终的答案就是搜索过程中bits出现的最多的1的各种,即```__builtin_popcount(bits)``` |