comefrom: <doocs>0057.Insert Interval_1.py
code: def merge(intervals):
      intervals.sort()
      ans = []
      st, ed = intervals[0]
      for s, e in intervals[1:]:
          if ed < s:
              ans.append([st, ed])
              st, ed = s, e
          else:
              ed = max(ed, e)
      ans.append([st, ed])
      return ans
masked: def sample_funcname ( var_0 ) :
      var_0.sort ( )
      var_1 = [ ]
      var_2 , var_3 = var_0 [ 0 ]
      for var_4 , var_5 in var_0 [ 1 : ] :
          if var_3 < var_4 :
              var_1.append ( [ var_2 , var_3 ] )
              var_2 , var_3 = var_4 , var_5
          else :
              var_3 = max ( var_3 , var_5 )
      var_1.append ( [ var_2 , var_3 ] )
      return var_1
  