Created
January 29, 2015 16:39
-
-
Save bkmorse/ca0ea7553489ccb78911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find_max_sum($v) { | |
$sum = 0; | |
for($i = 0; $i < count($v); $i++) | |
{ | |
if($i%2===0) | |
{ | |
$sum = $v[$i] + $sum; | |
} | |
} | |
print $sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment