[C++] Sort using Comparator
The condition 1 <= nums[i].length() <= 100 tells us that we can\'t convert all strings to numbers and sort them as it would give us an overflow error. The only 
The condition `1 <= nums[i].length() <= 100` tells us that we can\'t convert all strings to numbers and sort them as it would give us an **overflow** error. The only way (not in python though) is to compare the strings. So, while comparing two strings, we have to consider\n1.Strings with different lengths\n2.Strings with same length\n\nIn the first case, obviously the string with the largest length has the largest value. In the second one, we can just compare and return the string with largest value. If we just use normal sorting, it would not check the first case `( "145" < "2" ) `. So we use a comparator to do the work. \n\n# Code\n```\nclass Solution {\npublic:\n    string kthLargestNumber(vector<string>& nums, int k) {\n        sort(nums.begin(),nums.end(),[](string &a,string &b){\n            return a.length()!=b.length()?a.length()>b.length():a>b;\n        });\n        return nums[k-1];\n    }\n};\n```\n\n# Complexity\n- Time complexity:$$O(nlog(n))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->
['Sorting', 'Quickselect', 'C++']