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

added 488 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 86 bytes

1=2#.1-((1 e.,@{@(<@(#~(-:~.)&>)@,@{@#"0;&i./@$)*/@,@{])"1 2],~$$"1,1:`[`]}"{~[:I.1-,)

Try it online!

The 2 long test cases time out on TIO, so I've removed them.

  • Creates a list of all 0-to-1 mutated versions of the input, with the input itself as the final element in that list.
  • For each of those, checks for the required minor, using brute force, returning 1 if a minor is found, 0 otherwise.
  • Swaps those zeros and ones
  • Convert to a binary number
  • Checks if the number is 1.
    • This will only be true of every 0-to-1 mutation has the minor, but the input does not.

J, 86 bytes

1=2#.1-((1 e.,@{@(<@(#~(-:~.)&>)@,@{@#"0;&i./@$)*/@,@{])"1 2],~$$"1,1:`[`]}"{~[:I.1-,)

Try it online!

J, 86 bytes

1=2#.1-((1 e.,@{@(<@(#~(-:~.)&>)@,@{@#"0;&i./@$)*/@,@{])"1 2],~$$"1,1:`[`]}"{~[:I.1-,)

Try it online!

The 2 long test cases time out on TIO, so I've removed them.

  • Creates a list of all 0-to-1 mutated versions of the input, with the input itself as the final element in that list.
  • For each of those, checks for the required minor, using brute force, returning 1 if a minor is found, 0 otherwise.
  • Swaps those zeros and ones
  • Convert to a binary number
  • Checks if the number is 1.
    • This will only be true of every 0-to-1 mutation has the minor, but the input does not.
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 86 bytes

1=2#.1-((1 e.,@{@(<@(#~(-:~.)&>)@,@{@#"0;&i./@$)*/@,@{])"1 2],~$$"1,1:`[`]}"{~[:I.1-,)

Try it online!

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