The relation is put in landscape mode :)
$R = \left\{(1, NULL), (2,1), (3,2), (4,2) \right\}$
Now, a tuple is output if where condition is TRUE. Here the where condition is NOT EXISTS which returns true iff we give empty set to it. So, the condition for output here is that the inner query should not return any tuple.
Based on query, the inner query returns a tuple if the 'A' value being considered exist in any of the tuple as a 'B' value. This happens for A values, 1 and 2 and hence NOT EXISTS is FALSE for these two as the inner query returns $\{(2,1)\}$ and $\{(3,2), (4,2)\}$ respectively. For the tuples $(3,2)$ and $(4,2)$, the inner query returns $\{\}$ and hence they are output. So, the output is $\{(3,2),(4,2)\}$ and answer is 2.