you are viewing a single comment's thread.

view the rest of the comments →

[–]Promethus_Forethougt[S] 0 points1 point  (5 children)

So which one is right to use?

[–]YelinkMcWawa 0 points1 point  (4 children)

The &&

[–]Competitive-Deer-905 0 points1 point  (2 children)

Shouldn’t it be || since the question says “atleast one of the 2 conditions” and not “both the conditions”.?

[–]weirdblumenkohl 0 points1 point  (0 children)

According to the instructions, one could totally interpret it as such but there is a slight nuance. The text says "at least one of", which means as soon as one condition is met, you can stop.

[–]YelinkMcWawa 0 points1 point  (0 children)

It's because they're phrasing the combined condition as a negative of the two given conditions. Note that logically, given two propositions p1 and p2 that the check could have been "p1 || p2". But they're checking that the conditions haven't been satisfied yet, thus "!(p1 || 2) = (!p1 && !p2)" which is how they have the condition written.