O(n) nth_element
Just use nth_element with custom comparator. \n\nnth_element is a quickselect, so it runs in O(n) average. For each step, we compare strings, but we can conside
Just use `nth_element` with custom comparator. \n\n`nth_element` is a quickselect, so it runs in O(n) average. For each step, we compare strings, but we can consider it a constant time as string size is limited to 100.\n\n**C++**\n```cpp\nstring kthLargestNumber(vector<string>& nums, int k) {\n    nth_element(begin(nums), begin(nums) + k - 1, end(nums), [](const auto &a, const auto &b){\n        return a.size() > b.size() ? true : a.size() < b.size() ? false : a > b;\n    });\n    return nums[k - 1];\n}\n```\n**Python**\nPython does not have a standard nth_element implementation, and the proper implementation is quite lengthy (e.g. using median of medians to pick the pivot). We could have used numpy.partition, but it only works with fixed-size numerics. So, we would use a standard sort instead.\n\n```python\nclass Solution:\n    def kthLargestNumber(self, nums: List[str], k: int) -> str:\n        return str(sorted([int(s) for s in nums], reverse=True)[k - 1])\n```
[]