Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan ...
Given a string containing only three types of characters: , and , write a function to check whether this string is valid. We define the validity of a string by these rules: Any left parenthesis must ...
2017-10-01 12:40 3 7548 推薦指數:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan ...
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: Note ...
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid ...
We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. ...
Given an array of characters, compress it in-place. The length after compression must always be ...
A magical string S consists of only '1' and '2' and obeys the following rules: The string S is magical because ...
題目描述 題目難度:簡單 給定一個只包括 '(',')','{','}','[',']' 的字符串,判斷字符串是否有效。 有效字符串需滿足: 左括號必須用相同類型的右括號閉合。左括號必須以正確的順序閉合。注意空字符串可被認為是有效字符串。 示例 1: 輸入: "()"輸出: true ...
題目描述如下: 給定一個字符串,驗證它是否是回文串,只考慮字母和數字字符,可以忽略字母的大小寫。 說明:本題中,我們將空字符串定義為有效的回文串。 示例 1: 示例 2: class Solution { public: bool isPalindrome ...