Skip to content

Instantly share code, notes, and snippets.

@barthflo
Last active August 8, 2020 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barthflo/0ccdf17aa1266c5a774528dee07e291a to your computer and use it in GitHub Desktop.
Save barthflo/0ccdf17aa1266c5a774528dee07e291a to your computer and use it in GitHub Desktop.
Created a pseudo-code algorithm
start maxBuy (real money, real price)
int maxBuy ← 0
IF money AND price > 0
As long as money >= price
money ← money - price
maxBuy ← maxBuy+1
End As long as
End IF
return maxBuy
end maxBuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment