Huawei Advanced Test 2015

Source: Internet
Author: User

Description: Enter a set of integers greater than or equal to 0, output according to the order from large to small, and if there is a sequential integer after sorting, only the maximum and minimum two numbers of consecutive numbers are output. All the integers you enter are different, that is, you do not have to consider the same conditions for two integers.

Run Time: Unlimited

Memory Limit: Unlimited

Input: A set of integers greater than or equal to 0, regardless of illegal input, separated by commas (",") between the integers, and the total input length is less than 100 bytes.

Output: After sorting, the individual integers are separated by commas (",").

Sample input: 1,4,7,2,5,8,9,11

Sample output: 11,9,7,5,4,2,1

Description: Enter a set of integers greater than or equal to 0, separated by commas (",") between the integers, the input total length is less than 4096, the output is removed after the repeated integer

Input: A set of integers separated by commas (",") between each integer

Output: separated by commas (",") between individual integers

Sample input: 9,9,2,3,6,5,2,21

Sample output: 9,2,3,5,21

Huawei Advanced Test 2015

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.