
LeetCode
ohcezzz
这个作者很懒,什么都没留下…
展开
-
344. Reverse String
344. Reverse String Description Write a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”. Solution class Solution { public String re原创 2017-10-29 19:14:31 · 216 阅读 · 0 评论 -
Judge Route Circle
657. Judge Route Circle Description 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 original place.Th原创 2017-10-29 18:29:54 · 284 阅读 · 0 评论 -
541. Reverse String II
541. Reverse String II Description 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 are less than k ch原创 2017-11-01 11:38:57 · 226 阅读 · 0 评论 -
345. Reverse Vowels of a String
345. Reverse Vowels of a StringWrite 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 = “leetcode”, retu原创 2017-11-01 15:59:49 · 229 阅读 · 0 评论 -
67. Add Binary
67. Add BinaryGiven two binary strings, return their sum (also a binary string).For example, a = "11" b = "1" Return "100".class Solution { public String addBinary(String a, String b) {原创 2017-11-18 17:24:38 · 192 阅读 · 0 评论 -
557. Reverse Words in a String III
557. Reverse Words in a String IIIGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "L原创 2017-11-29 11:17:00 · 232 阅读 · 0 评论 -
13. Roman to Integer
13. Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.class Solution { public int romanToInt(String s) { char [原创 2017-11-22 17:06:22 · 174 阅读 · 0 评论 -
58. Length of Last Word
58. Length of Last WordGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Not原创 2017-11-26 12:42:30 · 201 阅读 · 0 评论 -
434. Number of Segments in a String
434. Number of Segments in a StringCount 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 does not contain原创 2017-12-15 15:27:17 · 196 阅读 · 0 评论