input: from typing import List
  
  def find_unique_substrings(arr: List[str]) -> List[str]:
      """
      Given an array arr of size n consisting of non-empty strings, find an array result such that:
  
      result[i] is the shortest substring of arr[i] that does not appear as a substring in any of the other strings in arr. If multiple such substrings exist, result[i] should be the lexicographically smallest one. If no such substring exists, result[i] should be an empty string.
  
      Return the array result.
  
      Examples:
      >>> arr = ["cab","ad","bad","c"]
      ["ab","","ba",""]
      >>> arr = ["abc","bcd","abcd"]
      ["","","abcd"]
  
      Constraints:
      - n == arr.length
      - 2 <= n <= 100
      - 1 <= arr[i].length <= 20
      - arr[i] contains only lowercase English letters.
      """
output:     def find_unique_substrings(arr: List[str]) -> List[str]:
          def is_unique(sub: str, idx: int) -> bool:
              for i, other in enumerate(arr):
                  if i != idx and sub in other:
                      return False
              return True
  
          result = []
          
          for i, string in enumerate(arr):
              found = False
              for length in range(1, len(string) + 1):
                  substrings = sorted(set(string[j:j+length] for j in range(len(string) - length + 1)))
                  for substring in substrings:
                      if is_unique(substring, i):
                          result.append(substring)
                          found = True
                          break
                  if found:
                      break
              if not found:
                  result.append('')
  
          return result
  
  # Testing the provided examples
  assert find_unique_substrings(["cab","ad","bad","c"]) == ["ab","","ba",""]
  assert find_unique_substrings(["abc","bcd","abcd"]) == ["","","abcd"]