[Program Ape Face question selected 100 questions]10. Two digits in the sorted array and for the given value

Source: Internet
Author: User






The sword refers to the sum of two digits of S.

The sum of the points of offer and the successive positive sequence of s


Extension (1): Enter an array to infer that the array is not present in three digits I, J, K, satisfy I+j+k equals 0.

Extension (2): Suppose the input array is not sorted, but know the range of the numbers inside, other conditions are unchanged, how to find these two numbers in O (n) time? The basic idea is to first use the hash table to achieve O (n) sorting (please refer to the question series 57th). The next steps are all the same.



[Program Ape Face question selected 100 questions]10. Two digits in the sorted array and for the given value

Related Article

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.