Let si be the resosurces required by process i.
To avoid deadlock condition atleast, one process should be allocated all the resources it needs.
In worst case, let all processes are allocated si-1 resources
Then sum if (si-1) for i = 1 to n where n is number of processes must be less than total number of resources available.
i.e; sum of (si) - n < m (total number of resources available). Therefore in this question,
sum of resources needed for all the processes - 7(no. of processes) < 10 (total resources)
sum of resources needed for all the processes < 10+7 =17
Sorry , I did not know how to put sigma here, that's why the solution may appear a little unclear.
U can check for this solution in this link http://www.geeksforgeeks.org/operating-systems-set-16/