Skip to content

Commit b677cef

Browse files
committed
F# solution
1 parent 3ec3122 commit b677cef

File tree

1 file changed

+14
-0
lines changed
  • challenges/easy/find-missing-number/solutions/fdb86

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module FindMissingNumber =
2+
3+
let findMissing values=
4+
let minList, maxList = (List.min values, List.max values)
5+
let newValues = [ minList .. maxList ]
6+
let missing = List.sum newValues - List.sum values
7+
missing
8+
9+
10+
11+
let origList = [230; 222; 220; 224; 229; 221; 225; 223; 228; 226]
12+
13+
14+
printfn $"The missing number is: {findMissing origList}"

0 commit comments

Comments
 (0)