Put an array on the same id

Source: Internet
Author: User
Put the arrays under the same id into an array, which has the following arrays: & nbsp; data [1] 20 & nbsp; data [2] 30 & nbsp; data [1] 40 & nbsp; data [1] 50 & nbsp; data [2] 60 & nbsp; data [3] 70 is divided into the following groups & nbsp; data [1] array (20, 40, put the array under the same id in an array
Ladies and gentlemen,

There are the following arrays:
Data [1] = 20
Data [2] = 30
Data [1] = 40
Data [1] = 50
Data [2] = 60
Data [3] = 70

Divided into the following groups
Data [1] = array (20, 40, 50)
Data [2] = array (30, 60)
Data [3] = array (70)

Ask for algorithms to be highly efficient


------ Solution --------------------
Discussion

It is queried from the database, but cannot be grouped. The efficiency is too low.

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.