geeksforgeeks init, dp problem