[Community Puzzle] The Ultimate Test

Submitted my solution, but it failed Test 4 with below message:

8+97-65+4+21
8+97+6-5-42+1
8-9+76-5-4-2+1
8-9+7+6+54-2+1

Failure

Found: 8+97-65+4+21
Expected: 8+97+6-5-42+1

Looks like the test case is hardcoded to require the solution in exact order?

You may have missed the following sorting rule in the puzzle statement:

NOTE : Ordering priority is nothing > + > - .

NOTE : Ordering priority is nothing > + > - .

May I have more clarification regarding this rule?

line1: 8+97-65+4+21
line2: 8+97+6-5-42+1

Among above lines, line 1 should on top of line 2?
As after 8 and 97, the ordering should be comparing on 65 vs 6?

65 = nothing
6 = -

It should be:
+6 = +
-65 = -

Ok, suddenly “clicked” with the description, and able to solve it, together with all the edge cases from validators.

After I clean my messy code, will put into github as public repo.

Thanks for the reply and help.

While you have the right to post your solution in public, please do not post the link in this forum. I’ve deleted your post which contains the link. Thank you.