Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Week1/Valid Palindrome/Divya
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class Solution {
public:
static bool isValid(char c){
if((c<='z'&&c>='a')||(c>='A'&&c<='Z')||(c>='0'&&c<='9')){
return true;
}
return false;
}
bool isPalindrome(string s) {
int start = 0;
int end = s.length()-1;

while(start<end){
if(!isValid(s[start])){
start++;
}else if(!isValid(s[end])){
end--;
}else if(tolower(s[start])!=tolower(s[end])){
return false;
}else if(tolower(s[start])==tolower(s[end])){
start++;
end--;
}

}

return true;
}
};

1 change: 0 additions & 1 deletion Week1/Valid Palindrome/week1.md

This file was deleted.