Skip to main content
added 59 characters in body
Source Link
DJMcMayhem
  • 59.6k
  • 17
  • 196
  • 348

Brain-Flak, 63 bytes

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

Try it online!

This is 62 bytes of code and +1 byte for the -a flag.

I tried two other approaches, but unfortunately both of them were longer:

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

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

This should be a very short answer. In fact, if we didn't have to support negative numbers, we could just do:

([]<>)

But we have to compare the first input with 45 (ASCII -) first, which is most of the byte count of this answer.

An arithmetic solution might be shorter.

Brain-Flak, 63 bytes

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

Try it online!

I tried two other approaches, but unfortunately both of them were longer:

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

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

This should be a very short answer. In fact, if we didn't have to support negative numbers, we could just do:

([]<>)

But we have to compare the first input with 45 (ASCII -) first, which is most of the byte count of this answer.

An arithmetic solution might be shorter.

Brain-Flak, 63 bytes

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

Try it online!

This is 62 bytes of code and +1 byte for the -a flag.

I tried two other approaches, but unfortunately both of them were longer:

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

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

This should be a very short answer. In fact, if we didn't have to support negative numbers, we could just do:

([]<>)

But we have to compare the first input with 45 (ASCII -) first, which is most of the byte count of this answer.

An arithmetic solution might be shorter.

Source Link
DJMcMayhem
  • 59.6k
  • 17
  • 196
  • 348

Brain-Flak, 63 bytes

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

Try it online!

I tried two other approaches, but unfortunately both of them were longer:

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

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

This should be a very short answer. In fact, if we didn't have to support negative numbers, we could just do:

([]<>)

But we have to compare the first input with 45 (ASCII -) first, which is most of the byte count of this answer.

An arithmetic solution might be shorter.