MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / Pair

Class Pair

java/0920-number-of-music-playlists.java:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 }
35
36 class Pair {
37 int a;
38 int b;
39
40 public Pair(int a, int b) {
41 this.a = a;
42 this.b = b;
43 }
44
45 @Override
46 public boolean equals(Object obj) {
47 if (this == obj) return true;
48 if (obj == null || getClass() != obj.getClass()) return false;
49 Pair pair = (Pair) obj;
50 return a == pair.a && b == pair.b;
51 }
52
53 @Override
54 public int hashCode() {
55 return 31 * a + b;
56 }
57 }
58}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected