Condition for deadlock is
process * ( max need -1) = RESOURCES. ..(i)
here process = 3
each process requiring 2 units of resource R so maximum need is 2
so according to (i) 3(2-1) = x , here x = maximum number of resources
3 = x
x = 3
so at max 3 resources require to be in deadlock .
maximum resources require are 3 to be in deadlock so if we have (3+1 =4) resources then there is no deadlock.
hence maximum value is also 4 .