795 B
795 B
Maximum profit
Puzzle from rendezvous with cassidoo newsletter, July 23rd 2023.
Implementation in ANSI BASIC with prototype in Python.
Solution posted at https://strangeobject.space/@ooze/110770674393278897
How to run
Edit the last DATA
statement from the MAXPROFIT.BAS
file to specify the sequence. Update the loop counter on line
20 to the number of elements in that sequence.
Running the code requires a BASIC intepreter such as Bywater BASIC (bwBASIC). For
example, on Ubuntu, Debian, or Pop! OS systems, it can be installed from apt install bwbasic
.
bwbasic MAXPROFIT.BAS
Exit the interactive environment by typing Ctrl-D.