Documentation
¶
Index ¶
- func AddBinary(a string, b string) string
- func AddString(num1 string, num2 string) string
- func BalancedString(s string) int
- func CheckIfPangram(sentence string) bool
- func CheckInclusion(s1 string, s2 string) bool
- func ConvertToTitle(column int) string
- func CountDaysTogether(arriveAlice string, leaveAlice string, arriveBob string, leaveBob string) int
- func DigitCount(num string) bool
- func Evaluate(s string, knowledge [][]string) string
- func IsIsomorphic(s string, t string) bool
- func IsPalindrome(s string) bool
- func LengthOfLastWord(s string) int
- func LengthOfLongestSubstring(s string) int
- func LetterCombinations(digits string) []string
- func LongestCommonPrefix(strs []string) string
- func NumbersAscending(s string) bool
- func Partition(s string) [][]string
- func RomanToInt(s string) int
- func SimplifyPath(path string) string
- func SplitWordsBySeparator(words []string, separator byte) []string
- func TitleToNumber(title string) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BalancedString ¶
func CheckIfPangram ¶
CheckIfPangram reports whether sentence is pangram.
func CheckInclusion ¶
CheckInclusion returns true if s2 contains the permutation of s1.
func ConvertToTitle ¶
ConvertToTitle returns corresponding column title as it appears in an Excel sheet. e.g. A -> 1, B -> 2 , C -> 3,Z -> 26 AA -> 27, AB -> 28
func CountDaysTogether ¶
func DigitCount ¶
DigitCount returns true if for every index i in the range 0 <= i < n, the digit i occurs num[i] times in num, otherwise return false.
func IsIsomorphic ¶
IsIsomorphic returns true if all occurrences of a character in s can be replaced with another character while preserving the order of characters in t.
func IsPalindrome ¶
IsPalindrome returns true if s is palindrome.
It will convert all uppercase letters into lowercase letters and removing all non-alphanumeric characters.
func LengthOfLastWord ¶
LengthOfLastWord returns the length of the last word in the string. A word is a maximal substring consisting of non-space characters only.
func LengthOfLongestSubstring ¶
LengthOfLongestSubstring returns the length of the longest substring without repeating characters. link: https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/
func LetterCombinations ¶
func LongestCommonPrefix ¶
LongestCommonPrefix returns the longest common prefix string amongst an array of strings.
func NumbersAscending ¶
NumbersAscending returns true if all the numbers in s are strictly increasing from left to right. A sentence is a list of tokens separated by a single space with no leading or trailing spaces.
func RomanToInt ¶
func SimplifyPath ¶
func SplitWordsBySeparator ¶
SplitWordsBySeparator splits the words in the input slice by the given separator character. It returns a new slice containing the split words. If a word is empty after splitting, it is not included in the result. Example usage:
words := []string{"one.two.three", "four.five", "six"} separator := '.' result := SplitWordsBySeparator(words, separator) // result will be []string{"one", "two", "three", "four", "five", "six"}
func TitleToNumber ¶
TitleToNumber returns its corresponding column number.
Types ¶
This section is empty.