Find out the number of K-Large

Source: Internet
Author: User
Programming Question #: Find out the number of K-Large

Source: POJ (Coursera statement: The exercises completed on POJ will not count against the final results of Coursera. )

Note: Total time limit: 1000ms memory limit: 65536kB

Describe

The user enters N and K, then enters n positive integers (unordered), and the program finds the K-large number in cases where n integers are not sorted. Note that the K-large number means the number from the large to the small row in the K-bit.

Input

N

K

A1 A2 A3 A4 ... an

Output

B

Sample input
5232 3 12) 5 89
Sample output
32
Tips

This is a classic algorithm problem, is the company's common interview questions. After learning recursion and then look back at this problem, perhaps a new solution.

Find out the number of K-Large

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.