Cody

# Problem 112. Remove the air bubbles

Solution 1385407

Submitted on 19 Dec 2017 by Jacob Lavzin
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = [ 1 2 3 0 4 5 6 0 0 ]; b_correct = [ 0 0 0 1 2 3 6 4 5 ]; assert(isequal(bubbles(a),b_correct))

v = 1 0 6 x = 1 3 y = 2 ze = 1 vz = 0 w = 0 1 6 b = 0 1 6 v = 2 4 0 x = 1 2 y = 2 ze = 1 vz = 0 w = 0 2 4 b = 0 0 1 2 6 4 v = 3 5 0 x = 1 2 y = 2 ze = 1 vz = 0 w = 0 3 5 b = 0 0 0 1 2 3 6 4 5

2   Pass
a = [ 1 0 5 0 7 0 6 ]'; b_correct = [ 0 0 0 1 5 7 6 ]'; assert(isequal(bubbles(a),b_correct))

v = 1 0 5 0 7 0 6 x = 1 3 5 7 y = 4 ze = 3 vz = 0 0 0 w = 0 0 0 1 5 7 6 b = 0 0 0 1 5 7 6

3   Pass
a = [1 0; 1 1]; b_correct = [1 0; 1 1]; assert(isequal(bubbles(a),b_correct))

v = 1 1 x = 1 2 y = 2 ze = 0 vz = 0×1 empty double column vector w = 1 1 b = 1 1 v = 0 1 x = 2 y = 1 ze = 1 vz = 0 w = 0 1 b = 1 0 1 1

4   Pass
a = [0 8 0 6 -2]'; b_correct = [0 0 8 6 -2]'; assert(isequal(bubbles(a),b_correct))

v = 0 8 0 6 -2 x = 2 4 5 y = 3 ze = 2 vz = 0 0 w = 0 0 8 6 -2 b = 0 0 8 6 -2