Type1: Need 1 2 2
U have remain 5-(1+1+2)=1 instance
P1 take that instance and then released the resources
then P2 executes as it requires 2 more instances , then P3 executes
So, Type1 in safe state
Now Type 2 need 2 1 3 instances
Type2 remain 1 instances in hand
P2 takes that instance and executed
then P2 releases its resourses
P2 releases 2 instances
P1 requires 2 instances , it takes and executed
then P3 also executes
So, both are in safe state
Answer (B)