Ad

You are given an array with N numbers. N - 1 numbers are the same. You must find the unique number.

The input array will always have at least 3 numbers.
The input array can be very large. Be mindful of performance.

DO NOT USE GOOGLE!!!

DO NOT LOOK AT OTHER SUBMISSIONS!!!

DO NOT EDIT THE TEST CASES!!!

findUniqueNumber([ 1; 1; 1; 2; 1; 1 ]) = 2

findUniqueNumber([ 0; 0; 0.55; 0; 0 ]) = 0.55

module ExampleSolution

  let findUniqueNumber array =
    () // your code goes here

You are given an array with N numbers. N - 1 numbers are the same. You must find the unique number.

  • The input array will always have at least 3 numbers.
  • The input array can be very large. Be mindful of performance.

DO NOT USE GOOGLE!!!

DO NOT LOOK AT OTHER SUBMISSIONS!!!

DO NOT EDIT THE TEST CASES!!!

findUniqueNumber([ 1; 1; 1; 2; 1; 1 ]) = 2

findUniqueNumber([ 0; 0; 0.55; 0; 0 ]) = 0.55

Code
Diff
  • module ExampleSolution
    
      let findUniqueNumber array =
        () // your code goes here
    • module ExampleSolution
    • let findUniqueNumber array =
    • ()
    • () // your code goes here

You are given an array with N numbers. N - 1 numbers are the same. You must find the unique number.

  • The input array will always have at least 3 numbers.
  • The input array can be very large. Be mindful of performance.

NOTES:

  • NO GOOGLE ALLOWED!!!!!
  • DO NOT LOOK AT OTHER SUBMISSIONS!!!

findUniqueNumber([ 1; 1; 1; 2; 1; 1 ]) = 2

findUniqueNumber([ 0; 0; 0.55; 0; 0 ]) = 0.55

module ExampleSolution

  let findUniqueNumber array =
    ()
Code
Diff
  • module ExampleSolution
    
      let add a b = 
        let x = a
        let y = b
        x + y
    • module ExampleSolution
    • let add a b = a + b
    • let add a b =
    • let x = a
    • let y = b
    • x + y

add 2 numbers

module ExampleSolution

  let add a b = a + b