Problem Statement:
Consider a binary tree with N nodes (1 Root and N-1 descendants). Each node, X is related to the Root by some relations such as L, R, LL, LR... and so on, where X is left (L) to Root or left-left (LL) or right-left (RL) to Root and so on.
Perform the following operations to find the value of Sum.
Write a program to print Sum.
Constraints:
Problem Statement:
A field, represented as cells of an M * N matrix, is given. There are some carrots in every cell, and a rabbit is trying to cross the field while eating the carrots available on the way. He starts from the top-left cell and moves right or down in each step, and finally reaches the bottom-right cell.
Write a program to find the maximum number of carrots the rabbit can eat during the trip from the top-left cell to the bottom-right cell.
Note: The Rabbit always moves either to downfield or right field, and always consumes all the carrots available in the cells on its path.
Input Format: