Skip to content

guneyin/go-path-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang path resolver challange app

Simple REST service which receives path tree data in json format, resolve and calculate max value of paths.

Run locally

Clone the project

  git clone https://github.com/guneyin/go-path-resolver.git

Go project directory

  cd go-path-resolver

Build project

  go build

Run

  .\go-path-resolver

API Usage

Request

  POST http:https://127.0.0.1:3001/

Body

{
    "tree": {
    "nodes": [
        {"id": "1", "left": "2", "right": "3", "value": 1},
        {"id": "3", "left": null, "right": null, "value": 3},
        {"id": "2", "left": null, "right": null, "value": 2}
    ],
    "root": "1"
    }
}

Response

{
    "path_sum": 4,
    "node_count": 3,
    "execute_duration": 0
}

Testing

Run the following command to run the tests

  go test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages