Dynamic Programming Approach Algorithm For Bubble