Re: [LeetCode] 刷到面试 Grind169 C++

楼主: SuiseiLeda (星街雷达)   2023-03-15 11:25:46
125. Valid Palindrome easy题
也是双指针的题
这次有想到怎么解
但判断大小写的函数没用过
所以还是有上网查
class Solution {
public:
bool isPalindrome(string s) {
int start = 0;
const int n = s.length();
int end = n-1;
while(start<end){
while(start<end && !isalnum(s[start])) start++;
while(start<end && !isalnum(s[end])) end
作者: DreaMaker167 (dreamaker)   2023-03-15 11:26:00
大师

Links booklink

Contact Us: admin [ a t ] ucptt.com