Swift - Using Quicksort
Hey everyone! Did this in swift and used a high order function: filter\n\nclass Solution {\n    \n    func sortArray(_ nums: [Int]) -> [Int] {\n        \n      
Hey everyone! Did this in swift and used a high order function: filter\n```\nclass Solution {\n    \n    func sortArray(_ nums: [Int]) -> [Int] {\n        \n        let sortedArray = quickSort(array: nums)\n        return sortedArray\n    }\n    \n    func quickSort(array: [Int]) -> [Int] {\n        \n        if array.count < 1 {\n            return array\n        }\n        \n        let pivot = array[array.count / 2]\n        let less  = array.filter { $0 < pivot }\n        let equal = array.filter { $0 == pivot }\n        let more  = array.filter { $0 > pivot }\n        \n        return quickSort(array: less) + equal + quickSort(array: more)\n        \n    }\n}\n```\n\nHappy Coding
['Swift']