Skip to main content
Code Golf

Return to Answer

added 480 characters in body
Source Link
Zgarb
  • 43.1k
  • 4
  • 82
  • 265

Husk, 14 bytes

§<ε#εu§m#u
m
<

Try it online!

Explanation

The two short lines are no-ops, since the main function never calls them.

§<ε#εu§m#u Implicit input, say S = "asasdd"
 u Remove duplicates: "asd"
 §m# For each, get number of occurrences in S: [2,2,2]
 u Remove duplicates: L = [2]
 #ε Number of elements in L that are at most 1: 0
 ε 1 if L is a singleton, 0 otherwise: 1
§< Is the former value smaller than the latter?

Husk, 14 bytes

§<ε#εu§m#u
m
<

Try it online!

Husk, 14 bytes

§<ε#εu§m#u
m
<

Try it online!

Explanation

The two short lines are no-ops, since the main function never calls them.

§<ε#εu§m#u Implicit input, say S = "asasdd"
 u Remove duplicates: "asd"
 §m# For each, get number of occurrences in S: [2,2,2]
 u Remove duplicates: L = [2]
 #ε Number of elements in L that are at most 1: 0
 ε 1 if L is a singleton, 0 otherwise: 1
§< Is the former value smaller than the latter?
Source Link
Zgarb
  • 43.1k
  • 4
  • 82
  • 265

Husk, 14 bytes

§<ε#εu§m#u
m
<

Try it online!

AltStyle によって変換されたページ (->オリジナル) /