title: How to trim spaces in a list (leetcode problem)?
body: <p>In my output, I have a list with spaces between elements, but the expected solution outputs a list with no spaces between elements, here's my code:</p>
  <pre><code>class Solution:
      def twoSum(self, nums: List[int], target: int) -&gt; List[int]:
          arr= []
          for i in range(0, len(nums)):
              for j in range(1, len(nums)):
                  if nums[i] + nums[j] == target:
                      arr.append(i)
                      arr.append(j)
          print(arr) 
      # output: [0, 1] / required: [0,1]
  </code></pre>