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