code: def sort_rgb_array(arr):
      n = len(arr)
  
      # indexes/pointers of the last element of each color
      r, g, b = 0, 0, 0
  
      for i in range(n):
          # swap the element and move the pointer
          if arr[i] == "R":
              swap(arr, i, r)
              r += 1
  
          # move pointer
          if r > g:
              g = r
  
          # swap the element and move the pointer
          if arr[i] == "G":
              swap(arr, i, g)
              g += 1
  
          # move pointer
          if g > b:
              b = g
  
          # swap the element and move the pointer
          if arr[i] == "B":
              swap(arr, i, b)
              b += 1
  
      return arr
  
label_desc: Use image node_id 1 for calling a global function with example usage: sort_rgb_array(arr) and returns: arr