All Posts

Leetcode 35: Search Insert Position

Given a sorted array of distinct integers and a target value, return the index of the target if it is present. If the target is not in the array, return the index where it should be inserted to maintain the sorted order.

Leetcode 66: Plus One

You are given a large integer represented as an array of digits. Each digits[i] represents the ith digit of the integer, arranged from most significant to least significant. The task is to increment the integer by one and return the resulting digits as an array.

Leetcode 67: Add Binary

You are given two binary strings, a and b. Each string represents a binary number. Your task is to compute their sum and return it as a binary string.

Leetcode 70: Climbing Stairs

You need to climb a ladder with n steps to reach the top. Each time, you can either climb 1 step or 2 steps. Find the number of distinct ways to climb to the top.

Leetcode 100: Same Tree

You are given two binary trees. Your task is to check if these two trees are the same. Two binary trees are considered the same if they are structurally identical and the nodes have the same value at each corresponding position.

Leetcode 94: Binary Tree Inorder Traversal

Given the root of a binary tree, return the values of its nodes as they appear in an inorder traversal. Inorder traversal visits nodes in the left subtree, the root, and then the right subtree.