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

Method count

python/2013-detect-squares.py:10–17  ·  view source on GitHub ↗
(self, point: List[int])

Source from the content-addressed store, hash-verified

8 self.pts.append(point)
9
10 def count(self, point: List[int]) -> int:
11 res = 0
12 px, py = point
13 for x, y in self.pts:
14 if (abs(py - y) != abs(px - x)) or x == px or y == py:
15 continue
16 res += self.ptsCount[(x, py)] * self.ptsCount[(px, y)]
17 return res

Callers 3

findMaxFormMethod · 0.45
dfsMethod · 0.45
zeroFilledSubarrayMethod · 0.45

Calls 1

absFunction · 0.50

Tested by

no test coverage detected