<commit_before>#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

// 4 Solutions using Partition, Max-Heap, priority_queue and multiset respectively.

class BaseSolution{

public:

    // Using C++ Standord function sort().
    // Time O(nlogn), Space O(1)
    virtual int findKthLargest(vector<int> &nums, int k)
    {
        sort(nums.begin(), nums.end());
        return nums[k - 1];
    }

};

/*
Solution 1: 
    using Partition(idea from quick-sort).
    Worest Case: 
        Select the least pivot Every time.
        Time O(n^2), Space O(1)
    Average Case:
        Time O(n)
    Best Case:<commit_msg>MODIFY. topK in array(4 Solutions).<commit_after>#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

// 4 Solutions using Partition, Max-Heap, priority_queue and multiset respectively.

class BaseSolution{

public:

    // Using C++ Standard function sort().
    // Time O(nlogn), Space O(1)
    virtual int findKthLargest(vector<int> &nums, int k)
    {
        sort(nums.begin(), nums.end());
        return nums[k - 1];
    }

};

/*
Solution 1: 
    using Partition(idea from quick-sort).
    Worest Case: 
        Select the least pivot Every time.
        Time O(n^2), Space O(1)
    Average Case:
        Time O(n)
    Best Case:
{'fraction_non_alphanumeric': 0.12351190476190477, 'fraction_numerical': 0.009672619047619048, 'mean_word_length': 2.7675070028011204, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4912053', 'n_tokens_mistral': 462, 'n_tokens_neox': 441, 'n_words': 137}