Sha256: 3820c837e38eb9d42f1af279ec6fa827b2ff951e79106d680af51209180d9da2

Contents?: true

Size: 268 Bytes

Versions: 262

Compression:

Stored size: 268 Bytes

Contents

module DifferenceOfSquares

let square x = x * x

let squareOfSums (number: int) = [1..number] |> List.sum |> square
let sumOfSquares (number: int) = [1..number] |> List.map square |> List.sum
let difference (number: int) = squareOfSums number - sumOfSquares number

Version data entries

262 entries across 262 versions & 1 rubygems

Version Path
trackler-2.2.1.4 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.3 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.2 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.1 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.1.0 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.6 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.5 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.4 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.3 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.2 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.1 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.2.0.0 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.55 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.54 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.53 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.52 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.51 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.50 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.49 tracks/fsharp/exercises/difference-of-squares/Example.fs
trackler-2.1.0.48 tracks/fsharp/exercises/difference-of-squares/Example.fs