A four digit number to be formed with digits 0,1,2,3 taken all at a time. If 1 will be in units place, we have four such numbers and so 2 and 3 will come in unit place four times.
Hence sum in units place =4(1+2+3)=24.
So will the sum be in tens and hundreds place. But in thousands place 1 will come 6 times and so the other non-zero digits. Hence sum in thousand's place will be =6(1+2+3)=6×6=36.
Hence, the required sum is 36×1000+24×100+24×10+24=38664.