Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 13 characters in body
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

, Pair the input with
 Z its transpose.
 f Ʋ Filter the pair to elements contained in:
 Jṁ=ⱮJƲ every matrix of the same dimensions with a single column of 1s.

 Jṁ Mold [1 .. len(input)] to the shape of the input.
 ⱮJ For each 1 .. len(input),
 = is each element equal to it?
 Jṁ=ⱮJƲ This computes every matrix of the same dimensions with a single column of 1s.

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

, Pair the input with
 Z its transpose.
 f Ʋ Filter the pair to elements contained in:
 Jṁ Mold [1 .. len(input)] to the shape of the input.
 ⱮJ For each 1 .. len(input),
 = is each element equal to it?
 Jṁ=ⱮJƲ This computes every matrix of the same dimensions with a single column of 1s.

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

, Pair the input with
 Z its transpose.
 f Filter the pair to elements contained in
 Jṁ=ⱮJƲ every matrix of the same dimensions with a single column of 1s.

 Jṁ Mold [1 .. len(input)] to the shape of the input.
 ⱮJ For each 1 .. len(input),
 = is each element equal to it?
added 366 characters in body
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNBIdea stolen from Razetime in TNB

, Pair the input with
 Z its transpose.
 f Ʋ Filter the pair to elements contained in:
 Jṁ Mold [1 .. len(input)] to the shape of the input.
 ⱮJ For each 1 .. len(input),
 = is each element equal to it?
 Jṁ=ⱮJƲ This computes every matrix of the same dimensions with a single column of 1s.

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

, Pair the input with
 Z its transpose.
 f Ʋ Filter the pair to elements contained in:
 Jṁ Mold [1 .. len(input)] to the shape of the input.
 ⱮJ For each 1 .. len(input),
 = is each element equal to it?
 Jṁ=ⱮJƲ This computes every matrix of the same dimensions with a single column of 1s.
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

,ZfJṁ=ⱮJƲ

Try it online!

Idea stolen from Razetime in TNB

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