Author Archives

Arpan Das

SDE II Amazon
Bengaluru, Karnataka, India

Path Sum

Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.

Unique Paths III

A robot is located at the top-left corner of a m x n grid (marked as ‘Start’ in the diagram below). The robot can either move right or diagonally at any point of time. The robot is trying to reach the top-right corner of the grid (marked as ‘Star’ in the diagram below). How many possible unique paths are there?