Skip to main content
1 of 3
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 697

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

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

He zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 697