Clash of Code: Didn't understand a problem

I just did a round of Clash and could not figure out the problem for the life of me:

inputs: 9 2
becomes: 711

inputs: 2 9
becomes: -711

inputs: 5 5
becomes: 010

I had to rule out arithmetic because of the 010 output scenario. I tried a number of bitshifts/character manipulation bits and pieces and still came up with nothing.

What bothers me more though is that if you fail to figure it out there’s no way of learning why.

Not sure whether it is allowed to share hints or solutions for Clash of code problems, but here is how I understood it:

Input: 9 2
9 - 2 = 7
9 + 2 = 11

Input: 2 9
2 - 9 = -7
2 + 9 = 11

Input: 5 5
5 - 5 = 0
5 + 5 = 10

I’ve never encountered that one before, so not sure it’s the right approach.

I think you got it, thought it was something far simpler than I was going for.

Thanks.

This one is (or used to be) available as a straight clash with problem statement and speed or golf mode. The problem statement is public information, there’s no reason it couldn’t be discussed.

1 Like