Skip to main content
added 1046 characters in body
Source Link
nimi
  • 35.9k
  • 4
  • 34
  • 99

Haskell, 90 7575 72 bytes

a[i]|d:n<-[[i|n<-i,n==a]|a<-i]=and[[i]<d,[d|i<-n]==n]--aadd,,,,:::::<=||

Each character appears 6 times. The input string is taken as a singleton list.

Try it online!

For reference, old versions:

75 bytes, each char 5 times

n(l)|d<-[[0|n<-l,n==a]|a<-l]=and[[0]<d!!0,all(==d!!0)d]--an!((())),,,0<[]||

Try it online!

Each character appears 5 times.

For reference: old version, 90 bytes, each char 3 times:

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Try it online!

Haskell, 90 75 bytes

n(l)|d<-[[0|n<-l,n==a]|a<-l]=and[[0]<d!!0,all(==d!!0)d]--an!((())),,,0<[]||

Try it online!

Each character appears 5 times.

For reference: old version, 90 bytes, each char 3 times:

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Try it online!

Haskell, 90 75 72 bytes

a[i]|d:n<-[[i|n<-i,n==a]|a<-i]=and[[i]<d,[d|i<-n]==n]--aadd,,,,:::::<=||

Each character appears 6 times. The input string is taken as a singleton list.

Try it online!

For reference, old versions:

75 bytes, each char 5 times

n(l)|d<-[[0|n<-l,n==a]|a<-l]=and[[0]<d!!0,all(==d!!0)d]--an!((())),,,0<[]||

Try it online!

90 bytes, each char 3 times:

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Try it online!

added 195 characters in body
Source Link
nimi
  • 35.9k
  • 4
  • 34
  • 99

Haskell, 9090 75 bytes

a x|h:u<n(l)|d<-[sum[1|d<[[0|n<-xl,notn==a]|a<-l]=and[[0]<d!!0,all(d/=c==d!!0)]|c<d]-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all-an!(not.(/=h())u),,,0<[]||

Try it online!

Each charcharacter appears three5 times. I've used the string " \"\\&,../1::>acdlmmnosst" to fill up the missing characters.

Try it online! For reference: old version, 90 bytes, each char 3 times:

                        c<-x     a -x|h:u<- for all char c in the input string x
     [1|d<[sum[1|d<-x,not(d/=c)]           -- take a 1 for every appearance of c in x
  sum                             -- add those 1s
h:u                               -- let h be the first sum and u the list
                                  -]|c<- of all other sums
     x]," ... ">[]                   -- a guard that always evaluates to true\"\\&, but
                                  -- is used to fill up the missing characters
   = h>1 &&                       -- return True if h > ../1 and
          all::>acdlmmnosst">[]=h>1&&all(not.(/=h))u         -- all the other sums are equal to h

Try it online!

Haskell, 90 bytes

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Each char appears three times. I've used the string " \"\\&,../1::>acdlmmnosst" to fill up the missing characters.

Try it online!

                        c<-x      -- for all char c in the input string x
     [1|d<-x,not(d/=c)]           -- take a 1 for every appearance of c in x
  sum                             -- add those 1s
h:u                               -- let h be the first sum and u the list
                                  -- of all other sums
     " ... ">[]                   -- a guard that always evaluates to true, but
                                  -- is used to fill up the missing characters
   = h>1 &&                       -- return True if h > 1 and
          all(not.(/=h))u         -- all the other sums are equal to h

Haskell, 90 75 bytes

n(l)|d<-[[0|n<-l,n==a]|a<-l]=and[[0]<d!!0,all(==d!!0)d]--an!((())),,,0<[]||

Try it online!

Each character appears 5 times.

For reference: old version, 90 bytes, each char 3 times:

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Try it online!

added 672 characters in body
Source Link
nimi
  • 35.9k
  • 4
  • 34
  • 99

Haskell, 90 bytes

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Each char appears three times. I've used the string " \"\\&,../1::>acdlmmnosst" to fill up the missing characters.

Try it online!

                        c<-x      -- for all char c in the input string x
     [1|d<-x,not(d/=c)]           -- take a 1 for every appearance of c in x
  sum                             -- add those 1s
h:u                               -- let h be the first sum and u the list
                                  -- of all other sums
     " ... ">[]                   -- a guard that always evaluates to true, but
                                  -- is used to fill up the missing characters
   = h>1 &&                       -- return True if h > 1 and
          all(not.(/=h))u         -- all the other sums are equal to h

Haskell, 90 bytes

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Each char appears three times. I've used the string " \"\\&,../1::>acdlmmnosst" to fill up the missing characters.

Try it online!

Haskell, 90 bytes

a x|h:u<-[sum[1|d<-x,not(d/=c)]|c<-x],"  \"\\&,../1::>acdlmmnosst">[]=h>1&&all(not.(/=h))u

Each char appears three times. I've used the string " \"\\&,../1::>acdlmmnosst" to fill up the missing characters.

Try it online!

                        c<-x      -- for all char c in the input string x
     [1|d<-x,not(d/=c)]           -- take a 1 for every appearance of c in x
  sum                             -- add those 1s
h:u                               -- let h be the first sum and u the list
                                  -- of all other sums
     " ... ">[]                   -- a guard that always evaluates to true, but
                                  -- is used to fill up the missing characters
   = h>1 &&                       -- return True if h > 1 and
          all(not.(/=h))u         -- all the other sums are equal to h
Source Link
nimi
  • 35.9k
  • 4
  • 34
  • 99
Loading