-
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.
Aug18: ease use of C++17 features [E]
LC551: use of ranges::count(s, 'A') < 2 and s.find("LLL") == string::npos
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -14,3 +14,5 @@ target/ | |
.* | ||
|
||
.clang-tidy | ||
|
||
build/ |
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,16 @@ | ||
#include <string> | ||
using namespace std; | ||
|
||
class Solution { | ||
public: | ||
/** | ||
* @brief LC: 551: Student Attendance Record I [E] | ||
* Just use the CPP feature, Time: O(N), Space: O(1) | ||
* | ||
* @param s | ||
* @return true, false | ||
*/ | ||
bool checkRecord(string s) { | ||
return ranges::counts(s, 'A') && s.find("LLL") == string::npos; | ||
} | ||
}; |