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

2 bytes off
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Brain-Flak, (削除) 94 (削除ここまで) 68(削除) 68 (削除ここまで) 66 bytes

({({}<>)<>})<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online! Try it online!

This seems a little long for the task. There might be a more convenient way to do this.

Explanation

First we calculate the sum of the stack with:

({({}<>)<>})

The we go through the entire stack adding that result to each element and modding by 2determine the pairity

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

Brain-Flak, (削除) 94 (削除ここまで) 68 bytes

({({}<>)<>})<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online!

This seems a little long for the task. There might be a more convenient way to do this.

Explanation

First we calculate the sum of the stack with:

({({}<>)<>})

The we go through the entire stack adding that result to each element and modding by 2

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

Brain-Flak, (削除) 94 (削除ここまで) (削除) 68 (削除ここまで) 66 bytes

({({}<>)<>})<>{<>(({})<({}<>{}<>(())){({}[()]<([{}])>)}{}>)<>}<>{}

Try it online!

This seems a little long for the task. There might be a more convenient way to do this.

Explanation

First we calculate the sum of the stack with:

({({}<>)<>})

The we go through the entire stack adding that result to each element and determine the pairity

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}])>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

saved a bunch
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Brain-Flak, 94(削除) 94 (削除ここまで) 68 bytes

({({}<>)<>}(())){({}[()]<([{}]())>)}{}<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online! Try it online!

This seems reallya little long for the task. I am pretty sure that there is There might be a more convenient way to do this.

Explanation

First we calculate the sum of the stack mod 2 with:

({({}<>)<>}(())){({}[()]<([{}]())>)}{}

The we go through the entire stack adding that result to each element and modding by 2

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

Brain-Flak, 94 bytes

({({}<>)<>}(())){({}[()]<([{}]())>)}{}<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online!

This seems really long for the task. I am pretty sure that there is a more convenient way to do this.

Explanation

First we calculate the sum of the stack mod 2 with:

({({}<>)<>}(())){({}[()]<([{}]())>)}{}

The we go through the entire stack adding that result to each element and modding by 2

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

Brain-Flak, (削除) 94 (削除ここまで) 68 bytes

({({}<>)<>})<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online!

This seems a little long for the task. There might be a more convenient way to do this.

Explanation

First we calculate the sum of the stack with:

({({}<>)<>})

The we go through the entire stack adding that result to each element and modding by 2

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Brain-Flak, 94 bytes

({({}<>)<>}(())){({}[()]<([{}]())>)}{}<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

Try it online!

This seems really long for the task. I am pretty sure that there is a more convenient way to do this.

Explanation

First we calculate the sum of the stack mod 2 with:

({({}<>)<>}(())){({}[()]<([{}]())>)}{}

The we go through the entire stack adding that result to each element and modding by 2

<>{<>(({})<({}<>{}<>(())){({}[()]<([{}]())>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.

({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

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