id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

andersoniii.edwin@cusd80.com > findOddEvenSumsInArrays
prev  |  next  |  chance

Given an array of integers, write the method to add the odd integers and add even integers - Return an integer array where in array[0] contains the sum of even integers and array[1] contains the sum of odd integers. If the array is empty, pass back an array with zeros located in both array locations.


findOddEvenSumsInArrays([1, 2, 3, 4]) → [6, 4]
findOddEvenSumsInArrays([]) → [0, 0]
findOddEvenSumsInArrays([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) → [30, 25]

...Save, Compile, Run (ctrl-enter)

public int[] findOddEvenSumsInArrays(int [] nums) }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 101

Copyright Nick Parlante 2017 - privacy