Kth Largest Element

    0

    0

    Aakanksha Priya

    Find the kth largest element from an array

    arr = [10, 11, 45, 89, 33, 30]
    arr_size = 6
    k = int(input("Largest element to get: "))
    arr.sort()
    print("Required element is: ",arr[-k])
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.