Sha256: a444362cd978ab3b6a9bd1d9e3a09e983feec4b5ffc8a7ea440f7d318a114774

Contents?: true

Size: 262 Bytes

Versions: 134

Compression:

Stored size: 262 Bytes

Contents

module DifferenceOfSquares

let square x = x * x

let squareOfSum (number: int) = [1..number] |> List.sum |> square
let sumOfSquares (number: int) = List.sumBy square [1..number]
let differenceOfSquares (number: int) = squareOfSum number - sumOfSquares number

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.179 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.178 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.177 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.176 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.175 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.174 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.173 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.172 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.171 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.170 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.169 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.167 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.166 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.165 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.164 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.163 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.162 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.161 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.160 tracks/fsharp/exercises/difference-of-squares/Example.fs