Skip to main content
Commonmark migration
Source Link

##Pyth, 22 19 bytes

Pyth, 22 19 bytes

Thanks to @isaacg for three bytes!

qFcMsMM,Jcz\/.-M_BJ

Explanation:

qFcMsMM,Jcz\/.-M_BJ      Implicit: z=input().
       ,                 two-element list
        Jcz\/              J = split z on ','
                _BJ      Bifurcate reverse: [J,reversed(J)]
             .-M         map multiset difference of elements in both lists
                             this gives the multiset difference both ways
       ,Jcz\/.-M_BJ      On input 1019/5095: [['1019','5095'], ['11','55']]
    sMM                  convert all strings to numbers
  cM                     map by float division
qF                       fold equality

Try it here.

##Pyth, 22 19 bytes

Thanks to @isaacg for three bytes!

qFcMsMM,Jcz\/.-M_BJ

Explanation:

qFcMsMM,Jcz\/.-M_BJ      Implicit: z=input().
       ,                 two-element list
        Jcz\/              J = split z on ','
                _BJ      Bifurcate reverse: [J,reversed(J)]
             .-M         map multiset difference of elements in both lists
                             this gives the multiset difference both ways
       ,Jcz\/.-M_BJ      On input 1019/5095: [['1019','5095'], ['11','55']]
    sMM                  convert all strings to numbers
  cM                     map by float division
qF                       fold equality

Try it here.

Pyth, 22 19 bytes

Thanks to @isaacg for three bytes!

qFcMsMM,Jcz\/.-M_BJ

Explanation:

qFcMsMM,Jcz\/.-M_BJ      Implicit: z=input().
       ,                 two-element list
        Jcz\/              J = split z on ','
                _BJ      Bifurcate reverse: [J,reversed(J)]
             .-M         map multiset difference of elements in both lists
                             this gives the multiset difference both ways
       ,Jcz\/.-M_BJ      On input 1019/5095: [['1019','5095'], ['11','55']]
    sMM                  convert all strings to numbers
  cM                     map by float division
qF                       fold equality

Try it here.

Golfed
Source Link
lirtosiast
  • 21.5k
  • 5
  • 52
  • 127

##Pyth, 2222 19 bytes

Thanks to @isaacg for three bytes!

qFmcFsMdqFcMsMM,Jcz\/m.-Fd_BJM_BJ

Explanation:

qFmcFsMdqFcMsMM,Jcz\/m.-Fd_BJM_BJ      Implicit: z=input().
       ,                 two-element list
        Jcz\/              J = split z on ','
        ,          _BJ      Bifurcate reverse: [J,reversed(J)]
              m.-FdM         map multiset difference of elements in both lists
                             this gives the multiset difference both ways
        ,Jcz\/,.-Fd_BJM_BJ      On input 1019/5095, we have: [['1019', '5095'], ['11', '55']]
  mcFsMd    sMM                for each element:
 convert all strings to numbers
  cM                     map foldby integerfloat division on each element after converting to int
qF                          fold equality

Try it here.

##Pyth, 22 bytes

qFmcFsMd,Jcz\/m.-Fd_BJ

Explanation:

qFmcFsMd,Jcz\/m.-Fd_BJ      Implicit: z=input().
         Jcz\/              J = split z on ','
        ,          _BJ      Bifurcate reverse: [J,reversed(J)]
              m.-Fd         map multiset difference
                             this gives the multiset difference both ways
        ,Jcz\/,.-Fd_BJ      On input 1019/5095, we have [['1019', '5095'], ['11', '55']]
  mcFsMd                    for each element:
                             fold integer division on each element after converting to int
qF                          fold equality

Try it here.

##Pyth, 22 19 bytes

Thanks to @isaacg for three bytes!

qFcMsMM,Jcz\/.-M_BJ

Explanation:

qFcMsMM,Jcz\/.-M_BJ      Implicit: z=input().
       ,                 two-element list
        Jcz\/              J = split z on ','
                _BJ      Bifurcate reverse: [J,reversed(J)]
             .-M         map multiset difference of elements in both lists
                             this gives the multiset difference both ways
       ,Jcz\/.-M_BJ      On input 1019/5095: [['1019','5095'], ['11','55']]
    sMM                  convert all strings to numbers
  cM                     map by float division
qF                       fold equality

Try it here.

added 618 characters in body
Source Link
lirtosiast
  • 21.5k
  • 5
  • 52
  • 127

##Pyth, 22 bytes

qFmcFsMd,Jcz\/m.-Fd_BJ

Explanation:

qFmcFsMd,Jcz\/m.-Fd_BJ      Implicit: z=input().
         Jcz\/              J = split z on ','
        ,          _BJ      Bifurcate reverse: [J,reversed(J)]
              m.-Fd         map multiset difference
                             this gives the multiset difference both ways
        ,Jcz\/,.-Fd_BJ      On input 1019/5095, we have [['1019', '5095'], ['11', '55']]
  mcFsMd                    for each element:
                             fold integer division on each element after converting to int
qF                          fold equality

Try it here.

##Pyth, 22 bytes

qFmcFsMd,Jcz\/m.-Fd_BJ

Try it here.

##Pyth, 22 bytes

qFmcFsMd,Jcz\/m.-Fd_BJ

Explanation:

qFmcFsMd,Jcz\/m.-Fd_BJ      Implicit: z=input().
         Jcz\/              J = split z on ','
        ,          _BJ      Bifurcate reverse: [J,reversed(J)]
              m.-Fd         map multiset difference
                             this gives the multiset difference both ways
        ,Jcz\/,.-Fd_BJ      On input 1019/5095, we have [['1019', '5095'], ['11', '55']]
  mcFsMd                    for each element:
                             fold integer division on each element after converting to int
qF                          fold equality

Try it here.

Source Link
lirtosiast
  • 21.5k
  • 5
  • 52
  • 127
Loading