Skip to main content
Commonmark migration
Source Link

#Mathematica, 54 bytes

Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}


#Mathematica, 82 bytes --WITH BONUS--

Mathematica, 82 bytes --WITH BONUS--

(s=#~NumberDecompose~#2;Row@Flatten@Table[Table[#2[[i]]"+",s[[i]]],{i,Length@s}])&

Input

[37.6, {15, 7, 2.5, 1, 0.88, 0.2, 0.01}]

output

15 +15 +7 +0.2 +0.2 +0.2 +

#Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}


#Mathematica, 82 bytes --WITH BONUS--
(s=#~NumberDecompose~#2;Row@Flatten@Table[Table[#2[[i]]"+",s[[i]]],{i,Length@s}])&

Input

[37.6, {15, 7, 2.5, 1, 0.88, 0.2, 0.01}]

output

15 +15 +7 +0.2 +0.2 +0.2 +

Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}


Mathematica, 82 bytes --WITH BONUS--

(s=#~NumberDecompose~#2;Row@Flatten@Table[Table[#2[[i]]"+",s[[i]]],{i,Length@s}])&

Input

[37.6, {15, 7, 2.5, 1, 0.88, 0.2, 0.01}]

output

15 +15 +7 +0.2 +0.2 +0.2 +

added 236 characters in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}


#Mathematica, 82 bytes --WITH BONUS--
(s=#~NumberDecompose~#2;Row@Flatten@Table[Table[#2[[i]]"+",s[[i]]],{i,Length@s}])&

Input

[37.6, {15, 7, 2.5, 1, 0.88, 0.2, 0.01}]

output

15 +15 +7 +0.2 +0.2 +0.2 +

#Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}

#Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}


#Mathematica, 82 bytes --WITH BONUS--
(s=#~NumberDecompose~#2;Row@Flatten@Table[Table[#2[[i]]"+",s[[i]]],{i,Length@s}])&

Input

[37.6, {15, 7, 2.5, 1, 0.88, 0.2, 0.01}]

output

15 +15 +7 +0.2 +0.2 +0.2 +

deleted 1 character in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 5254 bytes

NumberDecompose[#,#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}]&&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}

#Mathematica, 52 bytes

NumberDecompose[#,{100,50,20,10,5,2,1,.25,.1,.05,.01}]&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}

#Mathematica, 54 bytes

#~NumberDecompose~{100,50,20,10,5,2,1,.25,.1,.05,.01}&

input

[44.75]

output

{0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0.}

Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81
Loading