| about | help | code help+videos | done | prefs |
onesBeforeTwos
Write a method named onesBeforeTwos that returns an array where all the 1's are before the 2's. The provided array will only contain 1's and 2's. onesBeforeTwos([2, 2, 1]) → [1, 2, 2] onesBeforeTwos([1, 1, 2, 2, 1]) → [1, 1, 1, 2, 2] onesBeforeTwos([2, 1]) → [1, 2] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200 Post-solution available
Copyright Nick Parlante 2017 - privacy