3:32 AM
@B.Wilson That's a solid solution, but the original problem statement said it should add for all "non zero" element pairs, not "non negative".
@Jack I think your "abomination" is definitely excessive but it at least looks pretty. You're on the right track with trains, especially nesting trains, but you can get rid of a parenthesis pair at least:
and they should be the same. However, you were on the right track with the dfn. You can actually put in your own argument into the left "tine" instead of another operation.
This means we can rewrite your dfn as f←+×(0≠×)
, but the parenthesis is redundant, so you can write your function as f←+×0≠×