[C++] Sorting an array using recursion
Please note that this method will result in a TLE and only pass 10/13 of the test cases.\nI am sharing it because I feel it\'s a good application of recursion t
**Please note that this method will result in a TLE and only pass 10/13 of the test cases.\nI am sharing it because I feel it\'s a good application of recursion to sort an array**\n\n```\nclass Solution {\npublic:\n    vector<int> sortArray(vector<int>& nums) \n    {\n\t\t// Base Condition\n        if (nums.size() == 1)\n            return nums;  \n        // Hypothesis\n        vector<int> smallerUnsorted(nums.begin() + 1, nums.end());\n        vector<int> smallerSorted = sortArray(smallerUnSorted);\n        // Induction\n        vector<int> originalSorted;\n        int i = 0;\n        while (i < smallerSorted.size() && smallerSorted[i] <= nums[0])\n            originalSorted.push_back(smallerSorted[i++]);\n        originalSorted.push_back(nums[0]);\n        while (i < smallerSorted.size() && smallerSorted[i] > nums[0])\n            originalSorted.push_back(smallerSorted[i++]);\n        // Return sorted array\n        return originalSorted;\n    }\n};\n```
['Recursion', 'C']