public class Solution {
Stack<char> S = new Stack<char>();
Queue<char> Q = new Queue<char>();
public bool IsPalindrome(string s)
{
if (s.Length == )
{
return true;
}
s = s.ToLower();
foreach (var c in s)
{
if ((c >= 'a' && c <= 'z') || (c >= '' && c <= ''))
{
S.Push(c);
Q.Enqueue(c);
}
} while (S.Count > )
{
var ss = S.Pop();
var qq = Q.Dequeue();
if (ss != qq)
{
return false;
}
}
return true;
}
}

https://leetcode.com/problems/valid-palindrome/#/description

leetcode125的更多相关文章

  1. [Swift]LeetCode125. 验证回文串 | Valid Palindrome

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori ...

  2. leetcode125. Valid Palindrome

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori ...

  3. 【leetcode-125】 验证回文串

    给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写. 说明:本题中,我们将空字符串定义为有效的回文串. 示例 1: 输入: "A man, a plan, a c ...

  4. <LC刷题二>回文字符串判断之leetcode125&234

    其他刷题记录见博客首页 1,leecode125 验证回文串 原题: 给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写. 说明:本题中,我们将空字符串定义为有效的回文串. ...

  5. leetcode125. 验证回文串 python 简单

    125. 验证回文串 难度简单     给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写. 说明:本题中,我们将空字符串定义为有效的回文串. 示例 1: 输入: &quo ...

  6. Leetcode Note

    算法刷题笔记 Leetcode-11. Container With Most Water Method: (对撞指针)每次保留两指针中最大的那个即可求得最大的面积 Runtime: 16 ms, f ...

随机推荐

  1. JAVA多线程----用--进阶--》网络编程2

    import java.io.*; import java.net.*; /** * 服务器端逻辑线程 */ public class LogicThread extends Thread { Soc ...

  2. 【Git】Git的正确学习方式

    Git学习笔记 学习资料 git init git status git log 可以查看提交历史 git reset --hard commit_id git reflog查看命令历史 git ad ...

  3. 【解题报告】CF Round #320 (Div. 2)

    Raising Bacteria 题意:盒子里面的细菌每天会数量翻倍,你可以在任意一天放任意多的细菌,最后要使得某天盒子里面的细菌数量等于x,求至少要放多少个细菌 思路:显然,翻倍即为二进制左移一位, ...

  4. using中StreamWriter XmlWriter 区别

    使用StreamWriter using (var writer = new StreamWriter(File.Create(path))) { writer.WriteLine("sdf ...

  5. CF的Architecture,把它搞透!

    Architecture Cloud Controller - Maintains a database with tables for orgs, spaces, apps, services, s ...

  6. BZOJ4903 UOJ300 CTSC2017 吉夫特 【Lucas定理】

    BZOJ4903 UOJ300 CTSC2017 吉夫特 弱弱地放上题目链接 Lucas定理可以推一推,发现C(n,m)是奇数的条件是n" role="presentation&q ...

  7. SqlServer使用CONVERT 对时间进行格式化

    前言 在最近使用SqlServer的时候遇到时间格式的转换,特此记录下. 本文参考:https://www.cnblogs.com/xiaoleiel/p/8301027.html,如有侵权,请联系删 ...

  8. Java调用函数传递参数到底是值传递还是引用传递

    今天翻看微信上有关Java技术的公众号时,看到了一篇关于Java中值传递的问题,文章讨论了在Java中调用函数进行传参的时候到底是值传递还是引用传递这个面试时会问到的问题.之前也接触过类似的问题,但只 ...

  9. .NET Core 和 .NET Framework 中的 MEF2

    MEF,Managed Extensibility Framework,现在已经发布了三个版本了,它们是 MEF 和 MEF2. 等等!3 去哪儿了?本文将教大家完成基于 MEF2 的开发.   ME ...

  10. 【java基础】Java运算符优先级

    Java运算符优先级 序列号 符号 名称 结合性(与操作数) 目数 说明 1 . 点 从左到右 双目 ( ) 圆括号 从左到右   [ ] 方括号 从左到右   2 + 正号 从右到左 单目 - 负号 ...