# 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?

## Unique Paths II

The robot is trying to move in a obstacle grid.

## Unique Paths

Find Unique Paths in a 2D Grid from Source to Destination

## Longest Substring with At Most Two Distinct Characters

Given a string s, find the length of the longest substring t that contains at most 2 distinct characters.

## Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

## Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.

## Vertical Order Traversal of a Binary Tree

Given a binary tree, return the vertical order traversal of its nodes’ values.

## Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).

## Diameter of Binary Tree

Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.