ABAG - The implementation for the alternating trees problem specified in the task

ABAG - GO task

This repo contains the implementation for the alternating trees problem specified in the task.

Setting Up

Note: Uses Go 1.17+ Ensure that you have Golang installed on your system

Testing

go test

~ Test cases are specified in the "abag_test.go" file.

Note: Ensure that test coverage is always at 100%

Examples

gardenRow := []int{1,2,3,4,5}
count := abag.Solution(gardenRow)
fmt.Println(count)

The "solution" method returns the possible number of trees to cut down for the garden to be aesthetically pleasing.

Go DOC

package abag // import "personal/abag"

Package abag provides the solution function for the alternating trees
problem.

FUNCTIONS

func Solution(a []int) int
    Solution returns the number of ways of cutting out one tree if given an
    array a consisting of n integers, where A[K] denotes the height of the K-th
    tree, so that the remaining trees are aesthetically pleasing. If it is not
    possible to achieve the desired result, it returns −1. If
    the trees are already aesthetically pleasing without any removal then it returns 0.
Similar Resources

Prismforce-task - Assignment to test fundamental knowledge for Prism Force

Technical Assignment Assignment to test fundamental knowledge for Prism Force. T

Feb 15, 2022

Job queuing service and async task runner.

Valet Stateless Go server responsible for running tasks asynchronously and concurrently. Overview Job Pipeline Architecture Installation Configuration

Dec 22, 2022

Terraform provider implementation for interacting with the Tailscale API.

Terraform Provider Tailscale This repository contains a Terraform provider implementation for interacting with the Tailscale API.

Oct 3, 2022

OpenTelemetry-Go is the Go implementation of OpenTelemetry

OpenTelemetry-Go is the Go implementation of OpenTelemetry. It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms.

Dec 30, 2022

A simple implementation to upload file to AWS S3

A simple implementation to upload file to AWS S3.

Nov 19, 2021

School POC of an AES implementation in an API/Client system

poc_aes_implement School POC of an AES implementation in an API/Client system How to use : Start the api with : poc-aes -api start Client commands : p

Nov 29, 2021

A work-in-progress implementation of MobileMe.

mobileme A work-in-progress implementation of MobileMe. At the moment, authentication is assumed to be with the username someuser and password testing

May 28, 2022

An implementation of a simple RESTful API in Golang on AWS infrastructure.

go-api An implementation of a simple RESTful API in Golang on AWS infrastructure. Tech Stack Serverless framework Go language AWS API Gateway AWS Lamb

Dec 25, 2021

Unofficial golang implementation for the pipl.com search API

Unofficial golang implementation for the pipl.com search API

go-pipl The unofficial golang wrapper for the pipl.com API. Table of Contents Installation Documentation Examples & Tests Benchmarks Code Standards Us

Nov 6, 2022
My Simple Instagram-Clone API task submission, conducted by Appointy for internship shortlisting.

go-pointy Go-Pointy is a simple Instagram API Clone, made using GoLang. I had tried my best to not be lazy and finish the tasks, as a beginner to the

Jul 25, 2022
The task given by Appointy completed to develop APIs for a basic version of Instagram.

✨ Instagram APIs ✨ The task given by Appointy completed to develop APIs for a basic version of Instagram. Create an User Get User by Id Create a Post

Oct 9, 2021
The task is to develop a basic version of a Instagram.
The task is to develop a basic version of a Instagram.

Golang-api-task Developer: Mukka Deepak The task is to develop a basic version of aInstagram. You are only required to develop the API for the system.

Oct 23, 2021
Instagram clone as Appointy task
Instagram clone as Appointy task

Instagram Backend Clone Task for Appointy Internship 2021 Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About the Proj

Oct 11, 2021
Recruitment task.

Clients-emails project. Description. Microservice that stores clients and send them emails based on mailing ID. The service uses Go and PostgreSQL. Bo

Nov 24, 2021
A Google interview task my friend told me about.

deriving π given a normal distribution Try it yourself: package main import ( "fmt" "github.com/cpmech/gosl/rnd" ) // normal returns a number acc

Dec 16, 2021
Support variable parameters task send worker

go-worker-pool Support variable parameters task send worker 调用方式 go get github.com/214200196/gwp/v1 import ( "fmt" "github.com/214200196/gwp/v1" "

Dec 16, 2021
Stq - Simple Task Queue with REST API

stq Simple Tasks Queue with HTTP API Environments list: Variable Value BACKEND m

Jan 5, 2022
MealPlanr is an application dedicated to the trivial and boring task of meal planning 📅 and generating a shopping list 🛒 .
MealPlanr is an application dedicated to the trivial and boring task of meal planning 📅 and generating a shopping list 🛒 .

MealPlanr is an application dedicated to the trivial and boring task of meal planning ?? and generating a shopping list ?? .

Mar 1, 2022
Run vscode task in command line

vstask Run vscode task in command line install go install "github.com/ttttmr/vstask" usage NAME: vstask - Run vscode task in command line USAGE:

Jul 1, 2022