Skip to content

small fixes to problem tests #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion array/equal_sum_subarrays_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
/*
TestEqualSumSubArrays tests solution(s) with the following signature and problem description:

func EqualSubArrays(list []int) [][]int {
func EqualSubArrays(list []int) [][]int

Given an list of integers A, return two sub-arrays with equal sums without changing the
order of the elements in the list.
Expand Down
2 changes: 1 addition & 1 deletion backtracking/permutations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
/*
TestPermutations tests solution(s) with the following signature and problem description:

func Permutations(input []int) [][]int {
func Permutations(input []int) [][]int

Given a list of integers like {1,2}, produce all possible combinations like {1,2},{2,1}.
*/
Expand Down
2 changes: 1 addition & 1 deletion backtracking/sudoku_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type boardAndSolution struct {
/*
TestSudoku tests solution(s) with the following signature and problem description:

func Sudoku(board [][]int) bool {
func Sudoku(board [][]int) bool

Given a partially filled 9x9 grid with integers from 1 to 9 representing a Sudoku
board and 0 representing an empty slot that needs to be filled, write a function
Expand Down
2 changes: 1 addition & 1 deletion bit/division_without_operators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "testing"
/*
TestDivision tests solution(s) with the following signature and problem description:

func Divide(x, y int) int {
func Divide(x, y int) int

Divide x by y, two integers without using the built-in `/` or `*` operators.
*/
Expand Down
2 changes: 1 addition & 1 deletion dnc/towers_of_hanoi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
/*
TestTowerOfHanoi tests solution(s) with the following signature and problem description:

func TowerOfHanoi(n, start, end int) [][2]int {
func TowerOfHanoi(n, start, end int) [][2]int

Given n, number of disks, and start and end tower, return the moves it takes to move all
disks from start to end tower. The disks are stacked on top of each other with the
Expand Down
2 changes: 1 addition & 1 deletion dp/sum_up_to_integer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestSumUpToInteger tests solution(s) with the following signature and problem description:

SumUpToInteger(numbers []int, sum int) bool {
func SumUpToInteger(numbers []int, sum int) bool

Given a set of positive integers like {1,2,3,4,5} and an integer like 7 write a
function that returns true if there are two numbers in the list that sum up to the given
Expand Down
2 changes: 1 addition & 1 deletion graph/network_delay_time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "testing"
/*
TestNetworkDelayTime tests solution(s) with the following signature and problem description:

func NetworkDelayTime(n, k int, edges [][3]int) int {
func NetworkDelayTime(n, k int, edges [][3]int) int

Given `n`, the number of nodes in a network, a list of unidirectional travel times in
`{source, destination, delay}` format, and `k`, an origin node number, return the time it will
Expand Down
2 changes: 1 addition & 1 deletion graph/number_of_islands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestNumberOfIslands tests solution(s) with the following signature and problem description:

func NumberOfIslands(grid [][]int) int {
func NumberOfIslands(grid [][]int) int

Given a grid in which 0 represents water and 1 represents a piece of land, return the
number of islands. An Island is one or more piece of land that could be connected to other
Expand Down
2 changes: 1 addition & 1 deletion graph/word_ladder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "testing"
/*
TestWordLadder tests solution(s) with the following signature and problem description:

func WordLadder(start, end string, dic []string) int {
func WordLadder(start, end string, dic []string) int

Given a start word like `pop` and an end word like `car`, a dictionary of same length words
like `{"top","cop","cap","car"}` return the minimum number of transformations like 4 to get
Expand Down
4 changes: 2 additions & 2 deletions heap/sliding_maximum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
/*
TestMaxSlidingWindow tests solution(s) with the following signature and problem description:

func MaxSlidingWindow(numbers []int, k int) []int {
func MaxSlidingWindow(numbers []int, k int) []int

Given a list of integers like {1, 4, 5, -2, 4, 6}, and a positive integer k like 3, return
the maximum of each slice of the array when a window of length k is moved from left to the
right in the array like {4}.
right in the array like {5, 5, 5, 6}.
*/
func TestMaxSlidingWindow(t *testing.T) {
tests := []struct {
Expand Down
2 changes: 1 addition & 1 deletion linkedlist/reverse_in_place_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestReverseLinkedList tests solution(s) with the following signature and problem description:

func ReverseLinkedList(head *Node) *Node {
func ReverseLinkedList(head *Node) *Node

Reverse a given linked list in place.
*/
Expand Down
2 changes: 1 addition & 1 deletion linkedlist/serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestSerializeAndUnserializeLinkedList tests solution(s) with the following signature and problem description:

func Serialize(node *Node) string {
func Serialize(node *Node) string
func Unserialize(stringRepresentation string) *Node

Write a function that turns a linked list into a string representation, and then a function that turns that
Expand Down
2 changes: 1 addition & 1 deletion queue/maximum_of_sub_arrays_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
/*
TestMaxOfKLengthSubArrays tests solution(s) with the following signature and problem description:

func MaxOfKLengthSubArrays(numbers []int, k int) ([]int, error) {
func MaxOfKLengthSubArrays(numbers []int, k int) ([]int, error)

Given a set an array of numbers like {1,2,3,4,5} and a number k like 2 return the maximum in
each k-lengthed sub array. e.g. {2,3,4,5} corresponding to the max in each set of the sub
Expand Down
8 changes: 6 additions & 2 deletions queue/queue_using_stacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import "testing"
/*
TestQueueUsingStacks tests solution(s) with the following signature and problem description:

(usingStacks *UsingStacks) enqueue(n int) {
(usingStacks *UsingStacks) dequeue() int {
type UsingStacks struct {
stack1 Stack
stack2 Stack
}
(usingStacks *UsingStacks) enqueue(n int)
(usingStacks *UsingStacks) dequeue() int

Implement a queue of integers using stacks.
*/
Expand Down
2 changes: 1 addition & 1 deletion recursion/climbing_stairs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestClimbingStairs tests solution(s) with the following signature and problem description:

func ClimbingStairs(n int) int {
func ClimbingStairs(n int) int

Given n the number of steps, return in how many ways you can climb these stairs if you are
only able to climb 1 or 2 steps at a time.
Expand Down
2 changes: 1 addition & 1 deletion strings/longest_substring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
/*
TestLongestSubstrings tests solution(s) with the following signature and problem description:

func LongestSubstringOfTwoChars(input string) string {
func LongestSubstringOfTwoChars(input string) string

Given a string like "aabbc" return the longest substring of two unique characters like "aabb".
*/
Expand Down