leetCode 628: Given a list of numbers, find three numbers whose product is maximum and return the maximum product.
NB. This project is deveoped with cabal
and you need to install cabal
to compile and use it.
- Clone the repo
$ git clone [email protected]:codemascot/maxProd.git <path/to/the/project>
- Change directory to the path with
cd
$ cd <path/to/the/project>
- Compile the project using
cabal
$ cabal build
- Run the project with the executable
$ ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/maxProd-0.1.0.0/x/maxProd/build/maxProd/maxProd
Running the executable will give output in the prompt like below-
❯ ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/maxProd-0.1.0.0/x/maxProd/build/maxProd/maxProd
Input your list here as [1, 10, 2, 5, 6, 3] :
The result would be shown like below-
❯ ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/maxProd-0.1.0.0/x/maxProd/build/maxProd/maxProd
Input your list here as [1, 10, 2, 5, 6, 3] :
[1, 10, 2, 5, 6, 3]
300
Copyright © 2023 Khan Mohammad R. AKA CodeMascot