Created
May 14, 2024 16:04
-
-
Save chase-lambert/8177aeed590445628fa29b617fd84554 to your computer and use it in GitHub Desktop.
rendezvous with cassidoo challenge: 24.05.13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns max-product | |
(:require [clojure.test :refer [deftest is]])) | |
(defn max-product [nums] | |
(->> (sort nums) | |
(take-last 3) | |
(reduce * 1))) | |
(deftest max-product-test | |
(is (= 72 (max-product [2 4 1 3 -5 6])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rust version: