You are viewing a single comment's thread. Return to all comments →
Simple Java Solution
static int maxSubsetSum(int[] arr) { int a=arr[0]; int b=0; for(int i=1;i<arr.length;i++) { int temp=a; a=b+arr[i]; b=(int)Math.max(temp,b); } return (int)Math.max(a,b); }
Seems like cookies are disabled on this browser, please enable them to open this website
Max Array Sum
You are viewing a single comment's thread. Return to all comments →
Simple Java Solution