2013 Millet algorithm Problem

Source: Internet
Author: User
Title: In an array, except that the three numbers are the only ones that appear, the rest appear an even number to find any of the three numbers. For example, the array element is "1,2,3,5,2,3,4,4,6", only the 1,5,6 three number is the only occurrence, we only need to output one of the 1,5,6 in the line.

Ideas:

1. Sort 1,2,2,3,3,4,4,5,62. Find unique number 1) if x[i]==x[i+1] then i+=1 count++2) if x[i]!=x[i+1]&&count==0 then output x[i]3) else count=0

2013 Millet algorithm Problem

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.