2024.11.7
【力扣刷题】
125. 验证回文串 - 力扣(LeetCode)
bool isPalindrome(char* s) {int left = 0;int right = strlen(s) - 1;while (left < right) {while (left < right && (s[left] < 'A' || s[left] > 'Z') &&(s[left] < 'a' || s[left] > 'z') &&(s[left] < '0' || s[left] > '9')) {left++;}while (left < right && (s[right] < 'A' || s[right] > 'Z') &&(s[right] < 'a' || s[right] > 'z') &&(s[right] < '0' || s[right] > '9')) {right--;}if (s[left] >= 'A' && s[left] <= 'Z') {s[left] += 32;}if (s[right] >= 'A' && s[right] <= 'Z') {s[right] += 32;}if (s[left] != s[right]) {return false;}left++;right--;}return true;
}
——每天努力十五分钟,一年就努力了5475分钟,也就是91.25小时。(记得乘上0.7,这是扣去双休和法定的节假日的时间的)