You get equations of the form "p==q" or "p!=q", where p and q are lowercase letters standing for variables. Say whether the letters can be given values so that every equation holds. Our example: "a==b", "d!=b", "c!=a", "b==c" → false.
input
equations: equalities "p==q" and inequalities "p!=q", where p and q are lowercase letters standing for variables.
returns
true if the letters can be given values so that every equation holds; otherwise false.
constraints
1 ≤ equations.length ≤ 500
equations[i] is 4 characters: a lowercase letter, '==' or '!=', a lowercase letter
our 11 tests keep to them
examples
Open a test in the tests panel: it shows the input and the expected answer.