MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / money

Function money

GeeksForGeeks/Sister_and_Coins/Solution.cpp:18–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18int money(int a[],int n,int m,int sum)
19{
20 if(sum==m) // that means gila and mila have same amount of money
21 return 1;
22 if(sum<m)
23 return 0; // because Mila won't share her money
24 int x;
25 x=sum-m; // the amount that to be distributed between mila and gila
26 if(x%2!=0)
27 return 0; // amount to be distributed can't be in fraction
28 x=x/2;
29 if(findsum(a,n,x))
30 return 1;
31 return 0;
32}
33
34int main() {
35 int t; // t for no of test cases

Callers 1

mainFunction · 0.85

Calls 1

findsumFunction · 0.85

Tested by

no test coverage detected