Skip to main content
Commonmark migration
Source Link

Mathematica, 65

f=-Order@@MapIndexed[If[#>Last@#2,#,a-b#]&,PadRight[{##}+1],{2}]&

#Mathematica, 65 f=-Order@@MapIndexed[If[#>Last@#2,#,a-b#]&,PadRight[{##}+1],{2}]& UsageUsage:

f[{1, 2, 1, 1, 6}, {1, 2, 1, 1, 7}]

-1

#Mathematica, 65 f=-Order@@MapIndexed[If[#>Last@#2,#,a-b#]&,PadRight[{##}+1],{2}]& Usage:

f[{1, 2, 1, 1, 6}, {1, 2, 1, 1, 7}]

-1

Mathematica, 65

f=-Order@@MapIndexed[If[#>Last@#2,#,a-b#]&,PadRight[{##}+1],{2}]&

Usage:

f[{1, 2, 1, 1, 6}, {1, 2, 1, 1, 7}]

-1

Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

#Mathematica, 65 f=-Order@@MapIndexed[If[#>Last@#2,#,a-b#]&,PadRight[{##}+1],{2}]& Usage:

f[{1, 2, 1, 1, 6}, {1, 2, 1, 1, 7}]

-1