kiranpalsingh1806/DSA-Code-Snippets: Code Snippets for Data Structures and Algorithms. Problems from LeetCode, Codeforces and CodeChef for practice.

PHOTO EMBED

Wed May 14 2025 13:40:52 GMT+0000 (Coordinated Universal Time)

Saved by @gohilghanu

int findKthLargest(vector<int>& A, int k) {
    nth_element(begin(A), begin(A) + k - 1, end(A), greater<int>());
    return A[k - 1];
}
content_copyCOPY

https://github.com/kiranpalsingh1806/DSA-Code-Snippets