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

Rollback to Revision 8
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

05AB1E, 10(削除) 10 (削除ここまで) 8 bytes

Input is a list of bits.

gÑ ̈ʒôC.«^>gÑ ̈ʒιOÈP

Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.Try it online!

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ôι # splitpush the[a[0::b], inputa[1::b], into..., groupsa[(b of- that1)::b]] size
where a is the input Cb the divisor
 # convert each group from binary
 # this groups .«^the digits from #each group at reducethe bysame XORindex together
 O > # increment
sum each list
 ÈP # is thisare equalall tosums 1even?

05AB1E, 10 bytes

gÑ ̈ʒôC.«^>

Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ô # split the input into groups of that size
 C # convert each group from binary
 .«^ # reduce by XOR
 > # increment
 # is this equal to 1?

05AB1E, (削除) 10 (削除ここまで) 8 bytes

Input is a list of bits.

gÑ ̈ʒιOÈP

Try it online!

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ι # push [a[0::b], a[1::b], ..., a[(b - 1)::b]] where a is the input b the divisor
 # this groups the digits from each group at the same index together
 O # sum each list
 ÈP # are all sums even?
Rollback to Revision 7
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

05AB1E, (削除) 10 (削除ここまで) 810 bytes

Input is a list of bits.

gÑ ̈ʒιOÈPgÑ ̈ʒôC.«^>

Try it online! Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ιô # push [a[0::b],split a[1::b],the ...,input a[(binto -groups 1)::b]]of wherethat asize
 is the input b theC divisor
 # convert each group from #binary
 this groups the digits.«^ from each group# at the samereduce indexby togetherXOR
 O > # sumincrement
 each list
 ÈP # areis allthis sumsequal evento 1?

05AB1E, (削除) 10 (削除ここまで) 8 bytes

Input is a list of bits.

gÑ ̈ʒιOÈP

Try it online!

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ι # push [a[0::b], a[1::b], ..., a[(b - 1)::b]] where a is the input b the divisor
 # this groups the digits from each group at the same index together
 O # sum each list
 ÈP # are all sums even?

05AB1E, 10 bytes

gÑ ̈ʒôC.«^>

Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ô # split the input into groups of that size
 C # convert each group from binary
 .«^ # reduce by XOR
 > # increment
 # is this equal to 1?
deleted 391 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

05AB1E, 10(削除) 10 (削除ここまで) 8 bytes

Input is a list of bits.

gÑ ̈ʒôC.«^>gÑ ̈ʒιOÈP

Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.Try it online!

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ôι # splitpush the[a[0::b], inputa[1::b], into..., groupsa[(b of- that1)::b]] size
where a is the input Cb the divisor
 # convert each group from binary
 # this groups .«^the digits from #each group at reducethe bysame XORindex together
 O > # increment
sum each list
 ÈP # is thisare equalall tosums 1even?

05AB1E, 10 bytes

gÑ ̈ʒôC.«^>

Try it online!

(削除) I think the conversion from binary is not necessary and we can XOR the base-10 interpretation of the blocks for 9 bytes , but I currently can’t prove it. (削除ここまで) EDIT: @Arnauld found a counterexample , the 9-byter doesn't work.

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ô # split the input into groups of that size
 C # convert each group from binary
 .«^ # reduce by XOR
 > # increment
 # is this equal to 1?

05AB1E, (削除) 10 (削除ここまで) 8 bytes

Input is a list of bits.

gÑ ̈ʒιOÈP

Try it online!

Commented:

gÑ # push the divisors of the length of the input
 ̈ # remove the last one (the length itself)
 ʒ # filter this list on:
 ι # push [a[0::b], a[1::b], ..., a[(b - 1)::b]] where a is the input b the divisor
 # this groups the digits from each group at the same index together
 O # sum each list
 ÈP # are all sums even?
added 203 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
Rollback to Revision 4
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
added 494 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
added 239 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
Rollback to Revision 1
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
added 69 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164
Loading

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