Documentation ¶
Index ¶
- func AllGridOrientations(grid [][]string) [][][]string
- func CaesarShift(in string, shiftAmount int) string
- func CombinationsInts(nums []int, targetLength int) [][]int
- func MirrorStringGrid(grid [][]string) (flipped [][]string)
- func PermuteIntSlice(numbers []int) [][]int
- func PermuteString(str string) []string
- func PermuteStringSlice(in []string) [][]string
- func RandomInt(upper int) int
- func RotateIntGrid(grid [][]int) [][]int
- func RotateStringGrid(grid [][]string) [][]string
- func SlidingWindowSum(nums []int, targetSum int) (leftIndex, rightIndex int, found bool)
- func SplitStringOn(in string, cutset []string) []string
- func ThreeSum(nums []int, target int) (int, int, int, bool)
- func TwoSum(nums []int, target int) (num1 int, num2 int, found bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllGridOrientations ¶
AllGridOrientations returns the 8 possible orientations of a given grid i.e. rotated 4 times and the mirror image of all of those
func CaesarShift ¶
CaesarShift performs a forwards caesar shift of a given shiftAmount
func CombinationsInts ¶
CombinationsInts returns all combinations of an input slice of a given length
func MirrorStringGrid ¶
MirrorStringGrid returns the grid mirrored over the y-axis (i.e. left to right)
func PermuteIntSlice ¶
PermuteIntSlice will make all permutations of the numbers input
func PermuteString ¶
PermuteString generates all permutations for a given string
func PermuteStringSlice ¶
PermuteStringSlice will make all permutations of a string slice
func RotateIntGrid ¶
RotateGridInts will transpose a 2D array of ints
func RotateStringGrid ¶
RotateGrid returns the inputted grid, rotated counterclockwise call it multiple times for 180, & 270 degree rotations
func SlidingWindowSum ¶
SlidingWindowSum returns the left and right indices of a window within the nums slice, where all numbers in the slice [left:right] sum up to targetSum It also returns a boolean indicating if a valid window is found
func SplitStringOn ¶
SplitStringOn is like strings.Split but takes in a slice of strings that are all used as dividers in the incoming string
Types ¶
This section is empty.