Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.
Return the number of pairs of different nodes that are unreachable from each other.
 
Please complete the following python code precisely:
```python
class Solution:
    def countPairs(self, n: int, edges: List[List[int]]) -> int:
```