package
0.0.0-20211230051422-45e99aeff32b
Repository: https://github.com/achoarnold/cracking-the-coding-interview.git
Documentation: pkg.go.dev

# Functions

CheckPatternMatchesBruteForce checks if value matches pattern.
CheckPatternMatchesOptimized checks if value matches pattern.
ConvertNumberToString converts an integer into it's string counterpart.
CountFactorialZeros counts the number of zeros in the factorial of num.
DivideWithOnlyAddition implements x/y.
FindSmallestNonNegativeDifference returns the smallest non negative difference of any 2 elements in both arrays.
FindUnsortedSequence returns the start and left of a sequence of elements in an array such that if those elements are sorted, then the array will be sorted.
FlipSignWithAddition flips the sign of a number using only addition.
GetContiguousSequence returns the sum of largest sequence of elements in an input array.
GetContiguousSequenceBruteForce returns the sum of the largest sequence of increasing elements from an array by testing all elements.
GetDivingBoardLengths gets the length that can be made up of 2 weights.
GetDivingBoardLoop gets the length using 1 loop.
GetValidT9Words returns words in dictionary having a t9 encoding.
GetWordFrequency returns how many time a string exists in an input.
HasWonTicTacToe checks if a tic tac toe board contains a winner.
LangtonsAnt performs a simulation of the langtons ant.
MaxAliveYear gets the max year in which people are alive withing a certain range.
MaxNumWithoutComparison gets the max of 2 numbers without comparing.
MultiplyWithOnlyAddition multiplies two numbers using only addition.
NewLRUCache creates a new LRU cache.
PairsWithSum returns all pairs of numbers having a specific sum.
PondSizesBruteForce finds the length of all ponds in a matrix.
PondSizesOptimized finds all ponds with a specified length.
Rand7 generates a random number from 0-7.
SubtractWithOnlyAddition implements x - y.
SwapNumbersInPlace swaps 2 numbers without using any extra memory.
SwapNumbersInPlaceUsingBitOperations swaps 2 numbers using XOR operations.

# Structs

LRUCache is the data structure for an LRU cache.
MatrixPoint represents a point in a matrix.