随笔分类 -  string 3

186. Reverse Words in a String II
摘要:Given an input string , reverse the string word by word. Example: Input: ["t","h","e"," ","s","k","y"," ","i","s"," ","b","l","u","e"] Output: [" 阅读全文

posted @ 2018-11-09 07:26 猪猪🐷

541. Reverse String II
摘要: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 characters left, reverse all of t... 阅读全文

posted @ 2018-11-09 07:26 猪猪🐷

344. Reverse String
摘要:Write a function that takes a string as input and returns the string reversed. Example 1: Input: "hello" Output: "olleh" Example 2: Input: "A man, a plan, a canal: Panama" Output: "amanaP :lanac a ,n... 阅读全文

posted @ 2018-11-08 15:59 猪猪🐷

151. Reverse Words in a String
摘要:Given an input string, reverse the string word by word. Example: Input: "the sky is blue", Output: "blue is sky the". Note: * A word is defined as a sequence of non-space characters. * Input string... 阅读全文

posted @ 2018-11-08 15:46 猪猪🐷

345. Reverse Vowels of a String
摘要:Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Input: "hello" Output: "holle" Example 2: Input: "leetcode" Output: "leotcede" // correct May use ... 阅读全文

posted @ 2018-11-08 15:46 猪猪🐷

186. Reverse Words in a String II
摘要:Given an input string , reverse the string word by word. Example: Input: ["t","h","e"," ","s","k","y"," ","i","s"," ","b","l","u","e"] Output: [" 阅读全文

posted @ 2018-11-08 15:45 猪猪🐷

557. Reverse Words in a String III
摘要: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. Example 1: Input: "Let's take LeetCode contest" O... 阅读全文

posted @ 2018-11-08 15:45 猪猪🐷

345. Reverse Vowels of a String
摘要:Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Example 2: Input: "leetcode" Output: "leotcede" Exam 阅读全文

posted @ 2018-07-18 09:53 猪猪🐷

344. Reverse String
摘要:Write a function that takes a string as input and returns the string reversed. Example 1: Input: "hello" Output: "olleh" Example 2: Input: "A man, a p 阅读全文

posted @ 2018-07-18 09:47 猪猪🐷

导航