I don't normally bite when people are so lazy they can't even be bothered to Google for
what is a widely discussed subject[
^]
public bool sumIsPower(int[] arr)
{
if (arr == null || arr.Length == 0)
return false;
int total = 0;
for (int i = 0; i < arr.Length; ++i)
total += arr[i];
return (total != 0) && ((total & (total - 1)) == 0);
}
...think that should do it tho - had to write one of these out with a pencil for a job interview recently!