Skip to main content
Alternate solutions
Source Link
DLosc
  • 39.2k
  • 5
  • 83
  • 141

Pip, 22 18 bytes

^1>=Y^aNaYMNy=My>1

Attempt This Online!

Explanation

Each character occurs twice.

^1>=Y^aNaYMNy=My>1
      a             First command-line argument (a string)
     ^              Split into a list of characters
       Na           Count occurrences of each character in a
    Y               Yank the result into y
^1>=                No-op: compare with [1]
          MNy       Minimum of y
             =      is equal to
              My    Maximum of y
                >1  which is also greater than one
         Y          No-op: yank that result 
                    Autoprint the result of the last expression

Alternate 18-byterbyters:

Y^!1Y^aNaMNy=My!=1
Y_<=1Y_NaMa1<Ny=My

Pip, 22 18 bytes

^1>=Y^aNaYMNy=My>1

Attempt This Online!

Explanation

Each character occurs twice.

^1>=Y^aNaYMNy=My>1
      a             First command-line argument (a string)
     ^              Split into a list of characters
       Na           Count occurrences of each character in a
    Y               Yank the result into y
^1>=                No-op: compare with [1]
          MNy       Minimum of y
             =      is equal to
              My    Maximum of y
                >1  which is also greater than one
         Y          No-op: yank that result 
                    Autoprint the result of the last expression

Alternate 18-byter:

Y^!1Y^aNaMNy=My!=1

Pip, 22 18 bytes

^1>=Y^aNaYMNy=My>1

Attempt This Online!

Explanation

Each character occurs twice.

^1>=Y^aNaYMNy=My>1
      a             First command-line argument (a string)
     ^              Split into a list of characters
       Na           Count occurrences of each character in a
    Y               Yank the result into y
^1>=                No-op: compare with [1]
          MNy       Minimum of y
             =      is equal to
              My    Maximum of y
                >1  which is also greater than one
         Y          No-op: yank that result 
                    Autoprint the result of the last expression

Alternate 18-byters:

Y^!1Y^aNaMNy=My!=1
Y_<=1Y_NaMa1<Ny=My
Golfed 4 bytes
Source Link
DLosc
  • 39.2k
  • 5
  • 83
  • 141

Pip, 2222 18 bytes

I1&MY$=_Y_NaMa$=y&1NIy^1>=Y^aNaYMNy=My>1

Try it online!Attempt This Online!

Explanation

Each character occurs twice.

  ^1>=Y^aNaYMNy=My>1
      a             First command-line argument (a isstring)
 first command-line argument
I1&MY$=_  ^              No-opsSplit tointo makea thelist programof non-discriminatingcharacters
       Na     Ma      Count occurrences of each Mapcharacter thisin functiona
 to the characters ofY a:
         _Na     Yank the result into y
^1>=    Count occurrences of each character in a
      No-op: compare with Y[1]
          MNy     Yank the resultMinimum intoof y
             = $=y     is equal Foldto
 y on equals: truthy if all elements are equal
     My    Maximum of y
      &      Logical and
   >1  which is also greater than one
         1NIyY  1 is not in y
    No-op: yank that result 
                    Autoprint the result of the last expression

Alternate 22-byte version with fewer no18-opsbyter:

$&MY_Y_NaMa$=y&--1=1NyY^!1Y^aNaMNy=My!=1

Pip, 22 bytes

I1&MY$=_Y_NaMa$=y&1NIy

Try it online!

Explanation

Each character occurs twice.

                        a is first command-line argument
I1&MY$=_                No-ops to make the program non-discriminating
            Ma          Map this function to the characters of a:
         _Na             Count occurrences of each character in a
        Y               Yank the result into y
              $=y       Fold y on equals: truthy if all elements are equal
                 &      Logical and
                  1NIy  1 is not in y
                        Autoprint the result of the last expression

Alternate 22-byte version with fewer no-ops:

$&MY_Y_NaMa$=y&--1=1Ny

Pip, 22 18 bytes

^1>=Y^aNaYMNy=My>1

Attempt This Online!

Explanation

Each character occurs twice.

^1>=Y^aNaYMNy=My>1
      a             First command-line argument (a string)
     ^              Split into a list of characters
       Na           Count occurrences of each character in a
    Y               Yank the result into y
^1>=                No-op: compare with [1]
          MNy       Minimum of y
             =      is equal to
              My    Maximum of y
                >1  which is also greater than one
         Y          No-op: yank that result 
                    Autoprint the result of the last expression

Alternate 18-byter:

Y^!1Y^aNaMNy=My!=1
Source Link
DLosc
  • 39.2k
  • 5
  • 83
  • 141

Pip, 22 bytes

I1&MY$=_Y_NaMa$=y&1NIy

Try it online!

Explanation

Each character occurs twice.

                        a is first command-line argument
I1&MY$=_                No-ops to make the program non-discriminating
            Ma          Map this function to the characters of a:
         _Na             Count occurrences of each character in a
        Y               Yank the result into y
              $=y       Fold y on equals: truthy if all elements are equal
                 &      Logical and
                  1NIy  1 is not in y
                        Autoprint the result of the last expression

Alternate 22-byte version with fewer no-ops:

$&MY_Y_NaMa$=y&--1=1Ny