IBM Interview Question

bubble matrix manipulation, leetcode medium