All are written in Go, Please use Go version at least 1.22
To get started, follow these steps:
-
Clone the Repository:
git clone https://github.com/BoomNooB/supermans-chicken-rescue.git cd supermans-chicken-rescue
-
Running a makefile:
Simply just type this to your terminal aftercd
from step onemake run
then it will do a couple of thing herego mod tidy
for download and install dependenciesgo run ./cmd/app/main.go
for running the program
After that it will running with some testcase in
constant.go
file theTCN = map[string][]int{ FirstLine: {n, k}, SecondLine: {1, 2, 3, 4, 5, 6, 7, 8, 35, 120}, // position of each chicken }
and then add
constant.TCN
intomain.go
file intestCases
variable I've assume that the length ofSecondLine
are equal ton
as description in assessment sheet And you can runmake test
for running unit test file with verbose
- I still think that might be the way that I cannot figured out (yet) to not using nested for loop if I can do that, that would be decrease time complexity