comefrom: <doocs>1122.Relative Sort Array_1.py
code: def relativeSortArray( arr1: List[int], arr2: List[int]) -> List[int]:
      mp = [0] * 1001
      for x in arr1:
          mp[x] += 1
      i = 0
      for x in arr2:
          while mp[x] > 0:
              arr1[i] = x
              mp[x] -= 1
              i += 1
      for x, cnt in enumerate(mp):
          for _ in range(cnt):
              arr1[i] = x
              i += 1
      return arr1
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : List [ int ] ) -> List [ int ] :
      var_2 = [ 0 ] * 1001
      for var_3 in var_0 :
          var_2 [ var_3 ] += 1
      var_4 = 0
      for var_3 in var_1 :
          while var_2 [ var_3 ] > 0 :
              var_0 [ var_4 ] = var_3
              var_2 [ var_3 ] -= 1
              var_4 += 1
      for var_3 , var_5 in enumerate ( var_2 ) :
          for var_6 in range ( var_5 ) :
              var_0 [ var_4 ] = var_3
              var_4 += 1
      return var_0
  