norvig / pytudes

Python programs, usually short, of considerable difficulty, to perfect particular skills.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chaining comparisons and assumed uniqueness

snoyes opened this issue · comments

"in1: Set[int] = set(data(1, int))\n",

" if x != y)"

The puzzle description doesn't guarantee that each entry is unique; it's possible that a report contains the entry 1010 twice.

" if x != z != y)"

If we want to find unique entries anyway, this comparison chain does not preclude x == y. Perhaps use x < y < z ?