code: def swap_first_and_last_word(sentence):
      arr = [c for c in sentence]  # or just arr = list(sentence)
      first_idx = 0
      last_idx = len(arr) - 1
  
      # reverse the whole array, in this way I'll change the first and the last word
      reverse_array(arr, first_idx, last_idx)
  
      # find positions of the first and the last space char
      first_space = first_idx
      while arr[first_space] != " ":
          first_space += 1
  
      last_space = last_idx
      while arr[last_space] != " ":
          last_space -= 1
  
      # reverse only the first word
      reverse_array(arr, first_idx, first_space - 1)
      # reverse only the last word
      reverse_array(arr, last_space + 1, last_idx)
      # reverse everything between (with this reversing, all words between will have the same order as the starting one)
      reverse_array(arr, first_space + 1, last_space - 1)
  
      return "".join(arr)
  
label_desc: Use image node_id 1 for calling a global function with example usage: swap_first_and_last_word(sentence) and returns: str