I\'m looking to create a function that operates very closely to filter
Swift 4 Solution
partition(by:)
It reorders the origin array and returns start index of subarray satisfies the predicate.
In this example it returns 7.
0..<7 elemets aren't divisible by 3 and 7..n-1 elements are divisible by 3.
var numbers = [1,2,3,4,5,6,7,8,9,10]
let partition = numbers.partition(by: { $0 % 3 == 0 })
let divisibleBy3 = Array(numbers[..