標籤:: String

0

Basic Calculator II

Basic Calculator IIImplement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer

0

Restore IP Addresses

Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations. For example:123Given "25525511135",return ["255.255.11.13

0

Simplify Path

Simplify PathGiven an absolute path for a file (Unix-style), simplify it. For example:12path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 提

0

Group Anagrams

Group AnagramsGiven an array of strings, group anagrams together. For example:Given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”],Return: 12345[ ["ate", "eat","tea"], [&

0

Multiply Strings

Multiply StringsGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: The length of both num1 and num2 is < 110. Both num1 and num2 cont

0

Implement strStr()

Implement strStr()Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 提示 解題應用 TwoPointers KMP演算法 String 規律觀查 Defa

0

Generate Parentheses

Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example:Given n = 3, a solution set is: 1234567[ "((()))",

0

Letter Combinations of a Phone Number

Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons)

0

Integer to Roman

Integer to RomanGiven an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 提示 解題應用 Math 規律觀查 String 規律觀查 Default:123func intToRoman(num in

0

Repeated Substring Pattern

Repeated Substring PatternGiven 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 assume the given string

0

Longest Palindromic Substring

Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1:12345Input: "babad"Output: "b

0

Longest Substring Without Repeating Characters

Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For Examples:12345Given "abcabcbb", the answer is "

0

Reverse String II

Reverse String IIGiven 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, r

0

Detect Capital

Detect CapitalGiven 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 the following cases holds: All le

0

Number of Segments in a String

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 an

0

Reverse Vowels of a String

Reverse Vowels of a StringWrite a function that takes a string as input and reverse only the vowels of a string. Example1:1Given s = "hello", return "holle". Example 2:1Given s =

0

Ransom Note

Ransom NoteGiven an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the ma

0

First Unique Character in a String

First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. For Examples:12345s = "leetcode"return

0

Reverse String

Reverse StringWrite a function that takes a string as input and returns the string reversed. For Example:1Given s = "hello", return "olleh". 提示 解題應用 TwoPointers String D

0

Valid Palindrome

Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example:12"A man, a plan, a canal: Panama" is a palindrome.

0

Add Binary

Add BinaryGiven two binary strings, return their sum (also a binary string). For Example:123a = "11"b = "1"Return "100". 提示 解題應用 String 觀查規律 Math 觀查規律 Defaul

0

Length of Last Word

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