I have a list containing few elements like this: [1, 1, 2, 2, 3, 3]. I want to combine these numbers into one number without summing them so I want the final number to be: 112233; Is there a way to do it
>Solution :
you can use reduce method from list
List<int> list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
String s = "";
for(int i in list) {
s += i.toString();
}
int result = int.parse(s); //result = 12345678910
result maximum value is 2^63-1, otherwise you will get an overflow!!!