Dinesh Goyal's submission of Beautiful Subsequence | CodeChef