This file contains hidden or 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
class Solution { | |
public: | |
int lengthOfLongestSubstring(string s) { | |
// Start typing your C/C++ solution below | |
// DO NOT write int main() function | |
unsigned int result = 0; | |
set<char> table; | |
queue<char> substr; | |
for(int i = 0; i < s.length(); ++i) { | |
if(table.find(s[i]) != table.end()) { |
This file contains hidden or 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
class Solution { | |
public: | |
bool isPalindrome(string s) { | |
// Start typing your C/C++ solution below | |
// DO NOT write int main() function | |
string tmp = ""; | |
for(int i = 0; i < s.length(); ++i) { | |
if(!islower(s[i])) { | |
s[i] = tolower(s[i]); | |
NewerOlder