"""
Exercise 1: Satisfiability of Equality Equations (LeetCode 990)

equations like "a==b" or "b!=c" over single lowercase letters. Return True
if all can hold at once. Union every "==" pair first, then check that no
"!=" pair ended up in the same group.
"""

def equations_possible(equations):
    # TODO
    return False


# --- self-check: do not modify below this line ---
cases = [(["a==b", "b!=a"], False), (["b==a", "a==b"], True), (["a==b", "b==c", "a==c"], True), (["a==b", "b!=c", "c==a"], False), (["c==c", "b==d", "x!=z"], True)]
ok = True
for eq, want in cases:
    got = equations_possible(eq)
    print(eq, "->", got)
    ok = ok and got == want
print("PASS" if ok else "FAIL")
