Documentation ¶
Index ¶
- func ASCIIPalindrome(s string) bool
- func CalcNthLookSayNumber(n int) string
- func ComputeIpv4(s string) []string
- func ComputeWordsFromNumber(digits string) ([]string, error)
- func IntToString(number int) string
- func PrintSinusoidally(s string) string
- func RLD(s string) string
- func RLE(s string) string
- func ReplaceAndRemove(chars []rune, size int) int
- func Reverse(chars []rune)
- func ReverseWords(chars []rune)
- func RomanToDecimal(s string) int
- func StringToInt(s string) int
- func UTF8Palindrome(s string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASCIIPalindrome ¶
ASCIIPalindrome takes as input a string and checks if it is a palindrome. Takes O(N) time with O(1) space complexity.
func CalcNthLookSayNumber ¶
CalcNthLookSayNumber calculated the nth look and say number starting from the first one. Takes O(N*(2^n)) time complexity.
func ComputeIpv4 ¶
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 ¶
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 ¶
IntToString is an implementation of a integer to string conversion. Takes O(N) time with O(N) space complexity.
func PrintSinusoidally ¶
PrintSinusoidally prints a string sinusoidally Takes O(N) time complexity.
func RLD ¶
RLD (acronym for Run length decoding) is an decoding function for a string encoded using RLE. Takes O(N) time complexity.
func RLE ¶
RLE (acronym for Run length encoding) is an compression algorithm of strings. Takes O(N) time complexity.
func ReplaceAndRemove ¶
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 ¶
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 ¶
StringToInt is an implementation of a string to int conversion function. Takes O(N) time with O(1) space complexity.
func UTF8Palindrome ¶
UTF8Palindrome takes as input a utf8 enconded string and checks if it is a palindrome.
Types ¶
This section is empty.