# Convert complex number to array like crossing

if user input = 216789
then I want array output like that =
[ 22,21, 26, 27, 28, 29,11, 12, 16,17,18,19,62,61,66,67,68,69,71,71,76,77,78,79,82,81,86,87,88,89,92,91,96,97,98,99]

In other words, all possibilities of numbers entered by the user

is the user enters 1234 [this is four digit number then total possibilities 4 * 4 = 16}

so I want the output of all possibilities in array form that value entered by the user

1. Another concept
in this , user give two inputs
first input = 10 ;
second input = 50;

then i want array = [10,11,12,13,14…47,48,49,50];

on the other hand
first input = 50;
second input = 10;
then same output array like = [10,11,12,13…48,49,50];

What is the logic in creating this array? Why is the number `22` included? There is only one `2` in the input number?

Also, what would you expect the output to be if the user input was `212787`?

1 Like

This is just creating an array based on a range of numbers. Give it a try.

1 Like

is user enter = 212

then output = [22,21,22,12,11,12,22,21,22] = repeat the same number

if the user enter 3 digit then probability 3 * 3 = 9 chances

please give me line of code for jquery or javascript for this

You must attempt the code yourself. If you get stuck, then post your code.

1 Like

i have not idea for this