string

package
v0.0.0-...-a52c104 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertZ

func ConvertZ(s string, numRows int) string

ConvertZ 将一个给定字符串 s 根据给定的行数 numRows ,以从上往下、从左到右进行 Z 字形排列。

func IsMatch

func IsMatch(s string, p string) bool

IsMatch 正则匹配 leetcode10 todo: 10. 正则匹配 Level: High 给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 '*' 的正则表达式匹配。

'.' 匹配任意单个字符 '*' 匹配零个或多个前面的那一个元素 所谓匹配,是要涵盖 整个 字符串 s的,而不是部分字符串

func IsValid

func IsValid(s string) bool

IsValid 判断是否是有效括号 leetcode20 判断是否是有效括号 easy {[()]} == true [{]} == false 需要 队列

func LengthOfLongestDistinctSubstring

func LengthOfLongestDistinctSubstring(s string) int

LengthOfLongestDistinctSubstring 最长不重复子串的长度 leetcode3 s = "abcabcbb" 3 s = "bbbbb" 1 s = "pwwkew" 3 "" 0

func LetterCombinations

func LetterCombinations(digits string) []string

LetterCombinations 电话号码的字母组合 就是遍历排序组合啊 leetcode17 电话号码的字母组合

func LongestCommonPrefix

func LongestCommonPrefix(strs []string) string

LongestCommonPrefix 字符数组中的最长公共子串 leetcode14 字符数组中的最长公共子串

func LongestPalindrome

func LongestPalindrome(s string) string

LongestPalindrome 最长的回文子串

func Next

func Next(s string) []int

Next len=m S: a a a b b a b PMT: 0 1 2 0 0 1 0 Partical matching table: 部分匹配表; 下面是变形, 只要在O(m)下完成 PMT 局部变量表的匹配; 当发现没有匹配的就可以查询这个表快速定位了; Next: -10 1 2 0 0 1 NextJ: 0 1 2 3 1 1 2

func StrStr

func StrStr(haystack string, needle string) int

StrStr 实现strStr() 函数 Brute-Force leetcode28: 实现strStr() Level: easy 这不就是 字符串匹配到的索引值啊 字符串匹配的经典算法 这个搞可以 下面介绍KMP

func StrStrKMP

func StrStrKMP(haystack string, needle string) int

StrStrKMP 实现strStr() 函数 使用KMP 算法 leetcode28: 实现strStr() Level: easy 时间复杂度 O(m+n) needle: 针; haystack: 草垛; Author: Jinyun Liu

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL