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

 

james.shockey@austinisd.org > move68
prev  |  next  |  chance

move68 Given an integer array as input, return a new array of equal length with a new ordering of 6's and 8's. Whenever a 6 is encountered swap the next 8 into the position immediatly following the 6. the 6 will always occur first and there are equal numbers of 6's and 8's.


move68([1, 6, 1, 8]) → [1, 6, 8, 1]
move68([1, 6, 1, 8, 8, 6, 1]) → [1, 6, 8, 1, 1, 6, 8]
move68([6, 2, 2, 8]) → [6, 8, 2, 2]

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

public int[] move68(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

Copyright Nick Parlante 2017 - privacy