for example, for 1, 2, 128, 256 the output can be (16 digits):
1, 2, 128, 256
0000000000000001 0000000000000010 0000000010000000 0000000100000000
for(int i=0;i
str[i].length() is length of number say 2 in binary is 01 which is length 2 change 4 to desired max length of number. This can be optimized to O(n). by using continue.
str[i].length()