antstalepresh / max_profit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Requirement

Maximise Crypto profits As an input you receive an array of integer prices where prices[i] is the price of a given token on the ith day and an integer n. The task is to find the maximum achievable profit. You may complete up to n transactions: you may buy at most n times and sell at most n times. Note:

  • At any point of time you can own maximum of 1 token
  • You may not engage in multiple transactions simultaneously (i.e., you must sell the token before you buy again)

Commands

make test will run the unit tests

make run will run the service

make build will build the binary file

About


Languages

Language:Go 89.6%Language:Makefile 10.4%