<[[[{({}()<>)<>}<>({{}[()]})]]]>
Try it online!
Explanation
First the observations I made my first time around (that solution and its explanation is below) continue to be important here. We need and even number of ()
pairs for a valid answer.
This time however we are going to use a starting program that already has an even number of ()
s.
{({}()<>)<>}<>({{}[()]})
This program first increments every element by 1 then calculates the sum of 1 less than every element. If we look at all possible ways to delete from this without causing a bracket mismatch here are what they do:
{(()<>)<>}<>({{}[()]}) # Never halts
{({}<>)<>}<>({{}[()]}) # Sums 1 less than every element
{({}())<>}<>({{}[()]}) # One more than above
{({}()<>)}<>({{}[()]}) # Never halts
{({}()<>)<>}({{}[()]}) # No output
{({}()<>)<>}<>({[()]}) # Never halts
{({}()<>)<>}<>({{}[]}) # Complex output still incorrect
{(<>)<>}<>({{}[()]}) # Never halts
{({})<>}<>({{}[()]}) # Sums 1 less than every element
{({}()<>)<>}<>({{}}) # Sums 1 more than every element
{()<>}<>({{}[()]}) # Sums 1 less than every element
{({}()<>)<>}<>({}) # Adds 1 to every element
{<>}<>({{}[()]}) # Sums 1 less than every element
{({}()<>)<>}<>() # Adds 1 to every element
{}<>({{}[()]}) # Outputs 0
{({}()<>)<>}<> # Adds 1 to every element
<>({{}[()]}) # Outputs 0
{({}()<>)<>} # Outputs nothing
({{}[()]}) # Sums 1 less than every element
So this is a good starting place. To make it the correct sum I use the same method I outlined for the first attempt.
Now we just need the proper combination of [..]
s <..>
s and ((..){}){}
s to hit 2540. Unfortunately while [..]
s would be ideal seeing as they have the highest codepoint average I can't seem to get it to work with any of them present.
This time we are luckier and the winning combination is <[[[..]]]>
.
<<<<<<<<(((({{}})){}){}){}>>>>>>>>
Try it online!
Explanation
The code that does the task is ({{}})
. But we need to pad it to 2540. The main issue is that apart from ()
every pair has an even total. This means we need and even number of ()
pairs, and at the same time our starting code uses only 1 ()
pair.
On top of this unlike []
or <>
()
pairs are not so easy to add. The one way we can do that is to wrap the entire program in (..){}
, so to rectify our issue we alter the base program to
(({{}})){}
Now we just need the proper combination of [..]
s <..>
s and ((..){}){}
s to hit 2540. Unfortunately while [..]
s would be ideal seeing as they have the highest codepoint average I can't seem to get it to work with any of them present. The one that works is the one used above.
2540
? Just curious. \$\endgroup\$