First 3 processes 2,2,2 (They are in deadlock yet as each need 3 resource but we are giving them 2 resource each) (P1,P2,P3)
Left resources 10-6 Resources then 4 resources are remaining, Now from 4 remaining resources, Give one resource to each 3 different process(P4,P5,P6)
We are left with resources 4-3 ie 1 resource
As each need 3 resource Now to remove deadlock give this left 1 resource to any of P1,P2,P3 so that they satisfy there condition and will not be in deadlock after completing there request any one of them will release it's lock and system will not be in deadlock
So we need 6 maximum process hence N=6