File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Leetcode August 2020 Challenge Solutions | <img src =" https://visitor-badge.laobi.icu/badge?page_id=akashrajpurohit.leetcode-august-2020 " alt =" visitor badge " /> | ![ GitHub last commit (branch)] ( https://img.shields.io/github/last-commit/AkashRajpurohit/leetcode-august-2020-challenge/master )
2
+
3
+ > Solutions will be in CPP, might add solutions in other languages as well later.
4
+
5
+ [ Challenge Link] ( https://leetcode.com/explore/challenge/card/august-leetcoding-challenge/ )
6
+
7
+ ## Week 1 🚧
8
+ 1 . [ Detect Capital] ( https://leetcode.com/explore/challenge/card/august-leetcoding-challenge/549/week-1-august-1st-august-7th/3409/ ) ➡️ [ CPP Solution] ( Week1/detectCapital.cpp )
Original file line number Diff line number Diff line change
1
+ class Solution {
2
+ public:
3
+ bool detectCapitalUse (string word) {
4
+ int numOfCapitals = 0 ;
5
+
6
+ for (char ch: word) {
7
+ if (isupper (ch)) numOfCapitals++;
8
+ }
9
+
10
+ return numOfCapitals == word.size () || numOfCapitals == 0 || (numOfCapitals == 1 && isupper (word[0 ]));
11
+ }
12
+ };
You can’t perform that action at this time.
0 commit comments