随笔分类 -  leetcode_string

leetcode中String类型题目解法
摘要:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-10-17 16:27 daniel456 阅读(112) 评论(0) 推荐(0) 编辑
摘要:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-10-17 16:04 daniel456 阅读(111) 评论(0) 推荐(0) 编辑
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2017-10-17 15:59 daniel456 阅读(139) 评论(0) 推荐(0) 编辑
摘要:Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-10-17 10:45 daniel456 阅读(142) 评论(0) 推荐(0) 编辑
摘要:You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : L 阅读全文
posted @ 2017-10-17 10:42 daniel456 阅读(165) 评论(0) 推荐(0) 编辑
摘要:Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar 阅读全文
posted @ 2017-10-17 10:40 daniel456 阅读(108) 评论(0) 推荐(0) 编辑
摘要:Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi 阅读全文
posted @ 2017-10-17 10:33 daniel456 阅读(92) 评论(0) 推荐(0) 编辑
摘要:Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2017-10-17 10:16 daniel456 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2017-10-17 10:13 daniel456 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
posted @ 2017-10-17 10:03 daniel456 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
posted @ 2017-10-17 09:58 daniel456 阅读(111) 评论(0) 推荐(0) 编辑
摘要:Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s 阅读全文
posted @ 2017-10-16 21:58 daniel456 阅读(82) 评论(0) 推荐(0) 编辑
摘要:Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题目含义:翻转字符串 阅读全文
posted @ 2017-10-16 21:56 daniel456 阅读(114) 评论(0) 推荐(0) 编辑
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2017-10-16 21:55 daniel456 阅读(91) 评论(0) 推荐(0) 编辑
摘要:Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 题目含义:将两个字符串进行二进制加减法。 思路:从最后一位开始依次计算,注意进位 阅读全文
posted @ 2017-10-16 21:46 daniel456 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 给定两个字符串,判断一个字符串是不是另一个字符串 阅读全文
posted @ 2017-10-16 21:42 daniel456 阅读(103) 评论(0) 推荐(0) 编辑
摘要:给一串只包含有'(', ')', '{', '}', '[' 和']',的字符串,要求判定是否是合法的。 阅读全文
posted @ 2017-10-16 21:34 daniel456 阅读(87) 评论(0) 推荐(0) 编辑
摘要:Write a function to find the longest common prefix string amongst an array of strings. 写一个函数(或方法)来寻找一个字符串数组中的最长公共前缀。 注释 阅读全文
posted @ 2017-10-16 21:32 daniel456 阅读(84) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示