Skip to content

Commit 30c091d

Browse files
🎉 Day 1
0 parents  commit 30c091d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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)

Week1/detectCapital.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
};

0 commit comments

Comments
 (0)