Home > Back-end >  For a simple algorithm
For a simple algorithm

Time:12-10

Will a set [1, 2, 3]
Is divided into two collection

,1,1,2,2,2,3,3,3 [1]
,2,3,1,2,3,1,2,3 [1]

Order to corresponding

CodePudding user response:

refer to the original poster is afraid of pain don't love response:
to a collection of [1, 2, 3]
Is divided into two collection

,1,1,2,2,2,3,3,3 [1]
,2,3,1,2,3,1,2,3 [1]

Order to corresponding


 
List List=Arrays. AsList (1, 2, 3);
List List1=new ArrayList (a);
List List2=new ArrayList (a);
For (Integer I: list) {
For (Integer j: list) {
List1. Add (I);
List2. Add (j);
}
}
  • Related