The problem, in one line. Given statements like “a equals b” and “b is not c” over lowercase letters, say whether letters can be given values that make every statement true. LeetCode 990.
The tell. “Equals” is a group relation: if a equals b and b equals c, then a equals c. Anything that spreads that way, and asks whether two things end up in the same group, is union-find.