Leetcode 1704: Determine if String Halves Are Alike. All main languages

C++

class Solution {
public:
bool halvesAreAlike(string s) {
int n = s.length();
int count = 0;
set<char> vowels;
vowels.insert('a')…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store