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

 

list_evenlyOdd


list_evenlyOdd()--Mr. Guidry is a little odd about even and odd things in his lists. He dosen't like when he has odd values at even indexes, and even values at odd indexes.
This method iterates through a given integer list to remove all items that meet the following criteria: odd indexes with an even value, or even indexes with an odd value.

IMPORTANT NOTE: This method only removes the first item meeting the removal criteria during each pass of the list.

Write a method that will accomplish this and return the corrected list to Mr. Guidry's approval.


list_evenlyOdd([0, 2, 3, 4, 6, 9, 11]) → [0, 3, 4, 9]
list_evenlyOdd([]) → []
list_evenlyOdd([-2]) → [-2]

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

public List<Integer> list_evenlyOdd(List<Integer> 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

Post-solution available

Copyright Nick Parlante 2017 - privacy