title: Cannot assign value of type '()' to type '[Int]'
body: <p>Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.</p>
  
  <pre><code>Input: [3,1,2,4]
  Output: [2,4,3,1]
  The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
  </code></pre>
  
  <p>I have implemented following, but it throws me an error</p>
  
  <blockquote>
    <p>Line 17: cannot assign value of type '()' to type '[Int]'</p>
  </blockquote>
  
  <p>By the way, are there more elegant solution?</p>
  
  <pre><code>class Solution {
      func sortArrayByParity(_ A: [Int]) -&gt; [Int] {
          var oddTemp :[Int] = []
          var evenTemp :[Int] = []
  
          for a in A
          {
              if a%2 == 0
              {
                  evenTemp.append(a)
              }
              else
              {
                  oddTemp.append(a)
              }
          }
          // error is thrown in the following
          return evenTemp += oddTemp         
      }
  }
  </code></pre>