High Score algorithm, waiting.

Source: Internet
Author: User
Calculate an algorithm with high scores and wait online... This post was last edited by sibang from 2013-10-1622: 08: 17 & lt ;? PHP $ arrArray (Array (a, B, c), Array (d, e, f), Array (g, h, I ), the number of second-level arrays is unknown, so we only got 3 values for the convenience examples.) calculate an algorithm with high scores and wait online...

This post was last edited by sibang at 22:08:17, January 16 ,.

 $ Arr = Array (
Array ('A', 'B', 'C '),
Array ('D', 'e', 'F '),
Array ('G', 'H', 'I '),
// The number of items in the second array is unknown. for the convenience of the example, only three
);

$ X3 = iArray ($ arr, 3 );
Echo'
',Var_Dump($x3),'
';
/**
The expected result is:
Array {
'Adg', 'Adh ', 'AD ',
'AEG ', 'aeh', 'aei ',
'Afg', 'afh', 'afi ',
'Bdg', 'bdh', 'bdi ',
'Beg', 'beh', 'bei ',
'BFG', 'bfh', 'BFI ',
'Cdg', 'cdh', 'cdi ',
'Ceg', 'ceh', 'cei ',
'Cfg ', 'cfh', 'cfi ',
}
/**/

$ X2 = iArray ($ arr, 2 );
Echo'
',Var_Dump($x2),'
';
/**
The expected result is:
Array {
'Ad', 'AE', 'AF ',
'AG', 'AH', 'Ai ',
'Bd ', 'be', 'BF ',
'Bg ', 'Bh', 'bi ',
'CD', 'Ce ', 'CF ',
'Cg ', 'CH', 'ci ',
'Dg ', 'DH', 'di ',
'EG ', 'eh', 'Ei ',
'Fg', 'ff', 'Fi ',
}
/**/

Share:


------ Solution --------------------
A lot of flowers

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.