strings

package
v0.0.0-...-f0e9c47 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCIIPalindrome

func ASCIIPalindrome(s string) bool

ASCIIPalindrome takes as input a string and checks if it is a palindrome. Takes O(N) time with O(1) space complexity.

func CalcNthLookSayNumber

func CalcNthLookSayNumber(n int) string

CalcNthLookSayNumber calculated the nth look and say number starting from the first one. Takes O(N*(2^n)) time complexity.

func ComputeIpv4

func ComputeIpv4(s string) []string

ComputeIpv4 computes all valid ip addresses from a strings which represents an ip address but does not contains dots (for the individual octects). e.g 19216801. Takes O(1) time and O(1) space complexity.

func ComputeWordsFromNumber

func ComputeWordsFromNumber(digits string) ([]string, error)

ComputeWordsFromNumber takes as input a phone number encoded in a string. and returns all possible character sequence that correspond to the phone number. Takes O((4^n)*n) time complexity.

func IntToString

func IntToString(number int) string

IntToString is an implementation of a integer to string conversion. Takes O(N) time with O(N) space complexity.

func PrintSinusoidally

func PrintSinusoidally(s string) string

PrintSinusoidally prints a string sinusoidally Takes O(N) time complexity.

func RLD

func RLD(s string) string

RLD (acronym for Run length decoding) is an decoding function for a string encoded using RLE. Takes O(N) time complexity.

func RLE

func RLE(s string) string

RLE (acronym for Run length encoding) is an compression algorithm of strings. Takes O(N) time complexity.

func ReplaceAndRemove

func ReplaceAndRemove(chars []rune, size int) int

ReplaceAndRemove replaces each 'a' by two 'd' and removes each occurence of 'b' Takes O(N) time with O(1) space complexity.

func Reverse

func Reverse(chars []rune)

Reverse reverse the order. Takes O(N) time complexity with O(1) space.

func ReverseWords

func ReverseWords(chars []rune)

ReverseWords reverse the words in a string s. The string is passed as an array of runes into the function. Takes O(N) time with O(1) space complexity.

func RomanToDecimal

func RomanToDecimal(s string) int

RomanToDecimal converts a roman integer passed in as a string and returns it's value in base 10. Time complexity O(N) with O(1) space.

func StringToInt

func StringToInt(s string) int

StringToInt is an implementation of a string to int conversion function. Takes O(N) time with O(1) space complexity.

func UTF8Palindrome

func UTF8Palindrome(s string) bool

UTF8Palindrome takes as input a utf8 enconded string and checks if it is a palindrome.

Types

This section is empty.

Jump to

Keyboard shortcuts

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