title: Find Sum Unique Sub Array Sum Given Array
signature: findSumUniqueSubArraySumGivenArray :: [Integer] -> Integer -> Integer
  findSumUniqueSubArraySumGivenArray arr n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: [Integer] -> Integer -> Integer -> String
  driver arr n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME arr n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ([7, 24, 34, 35, 36, 40, 49, 51, 53, 74, 78]) (9) (5631) )
  
      printf "TEST-1...%s\n" (driver ([-34, 60, 32]) (2) (52) )
  
      printf "TEST-2...%s\n" (driver ([0]) (0) (0) )
  
      printf "TEST-3...%s\n" (driver ([80, 64, 10, 82, 14, 75, 51, 91, 1, 25, 98, 22, 36, 27, 21, 31, 93, 6, 52, 91, 80, 8, 62, 95, 10, 71, 40, 80, 35, 86, 85, 26, 74, 72, 64, 88, 4, 71, 4, 16]) (31) (207596) )
  
      printf "TEST-4...%s\n" (driver ([-94, -46, -36, -24, -22, 0, 10, 14, 34, 34, 90, 92, 98]) (9) (-1638) )
  
      printf "TEST-5...%s\n" (driver ([1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1]) (21) (0) )
  
      printf "TEST-6...%s\n" (driver ([19, 20, 20, 24, 25, 33, 43, 47, 57, 61, 61, 64, 65, 71, 72, 73, 75, 82, 90, 93, 95]) (15) (27034) )
  
      printf "TEST-7...%s\n" (driver ([-6, 56, 58, -36, 70, -92, 30, 58, -40, 98, 80, -96, -4, -88, 34, 76, 40, -32, -94, -26, 8, 72, -56, -96, -88, -24, 36, 14, -88, -32, 90, 4, -88, 28, 18]) (24) (1698) )
  
      printf "TEST-8...%s\n" (driver ([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) (11) (0) )
  
      printf "TEST-9...%s\n" (driver ([91, 51, 15, 78, 55, 3, 10, 24, 42, 84, 66, 78, 10, 41, 21, 53, 69, 57, 20, 22, 50, 72, 8, 80, 12, 91, 29, 95, 38, 74, 95, 26, 10, 57, 51, 25, 49, 74, 15, 42, 99, 21, 27]) (36) (267019) )
  
source_py: def find_sum_unique_sub_array_sum_given_array(arr, n):
      res = 0
      m = dict()
      for i in range(n):
          Sum = 0
          for j in range(i, n):
              Sum += arr[j]
              m[Sum] = (m.get(Sum, 0) + 1)
      for x in m:
          if (m[x] == 1):
              res += x
      return res
source_cpp: long long int find_sum_unique_sub_array_sum_given_array(vector<int> arr, int n) {
    int res = 0;
    unordered_map < int, int > m;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int sum = 0;
      for ( int j = i;
      j < n;
      j ++ ) {
        sum += arr [ j ];
        m [ sum ] ++;
      }
    }
    for ( auto x : m ) if ( x . second == 1 ) res += x . first;
    return res;
  }