79780599

Date: 2025-10-02 03:07:05
Score: 1
Natty:
Report link

Is there a way of doing this without an if-statement?

No.

"in either order" means that there are multiple possible result patterns.

There are 2 "in either order", so number of results is 4. However in this question case, the number of patterns to consider is 2. That is, swap target selection.

The results are not necessarily the same, and which pattern is valid depends on the inputs. So, it looks like that It is inevitable to select the pattern to be adopted based on the inputs.

(Of course, depending on the language you use, you may be able to write code that uses something other than if as a branching method, but it is not interest here.)

Reasons:
  • Blacklisted phrase (1): Is there a way
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Is there a
Posted by: fana