go_balanced_brackets

command module
v0.0.0-...-3fe5300 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 7 Imported by: 0

README

go_balanced_brackets

Checks if input file with lines of brackets are balanced, and match an output file give.

Usage

Usage of ./go_balanced_brackets:
  -i string
        Input file (default "input.txt")
  -o string
        Output file (default "output.txt")

File Format

File format is based from input and output files from HackerRank.

Input files first line is the count of brackets, and all other lines are brackets to be check. Ouput files are "YES" and "NO" base of if the matching brackets is balanced or not.

Unit tests and Benchmarks

go test will run the unit test go test -bench=. will run the benchmarks and output something like,

goos: linux
goarch: amd64
pkg: github.com/amscotti/go_balanced_brackets
cpu: 11th Gen Intel(R) Core(TM) i5-11400 @ 2.60GHz
BenchmarkCalculate-12             115782             10245 ns/op
PASS
ok      github.com/amscotti/go_balanced_brackets        1.297s

Build and run

go build and ./go_balanced_brackets -i input17.txt -o output17.txt

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL