Skip to content

Commit a098eb1

Browse files
committed
1119 added.
1 parent d1643a3 commit a098eb1

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(B)
3+
4+
set(CMAKE_CXX_STANDARD 14)
5+
6+
add_executable(B main.cpp)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/// Source : https://leetcode.com/problems/remove-vowels-from-a-string/
2+
/// Author : liuyubobobo
3+
/// Time : 2019-07-13
4+
5+
#include <iostream>
6+
#include <unordered_set>
7+
8+
using namespace std;
9+
10+
11+
/// Linear Scan
12+
/// Time Complexity: O(n)
13+
/// Space Complexity: O(1)
14+
class Solution {
15+
public:
16+
string removeVowels(string S) {
17+
18+
unordered_set<char> vowels = {'a', 'e', 'i', 'o', 'u'};
19+
string res = "";
20+
for(char c: S)
21+
if(!vowels.count(c))
22+
res += c;
23+
return res;
24+
}
25+
};
26+
27+
28+
int main() {
29+
30+
return 0;
31+
}

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,4 +763,5 @@ email: [liuyubobobo@gmail.com](mailto:liuyubobobo@gmail.com)
763763
| 1111 | [Maximum Nesting Depth of Two Valid Parentheses Strings](https://leetcode.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/) | [] | [C++](1111-Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings/cpp-1111/) | | |
764764
| | | | | | |
765765
| 1118 | [Number of Days in a Month](https://leetcode.com/problems/number-of-days-in-a-month/) | [] | [C++](1118-Number-of-Days-in-a-Month/cpp-1118/) | | |
766-
| | | | | | |
766+
| 1119 | [Remove Vowels from a String](https://leetcode.com/problems/remove-vowels-from-a-string/) | [] | [C++](1119-Remove-Vowels-from-a-String/cpp-1119/) | | |
767+
| | | | | | |

0 commit comments

Comments
 (0)