All Posts
Leetcode 63: Unique Paths II
A robot starts at the top-left corner of an m x n grid and needs to reach the bottom-right corner. The grid contains obstacles (marked as 1) and empty cells (marked as 0). The robot can only move down or right and cannot pass through cells with obstacles. Determine the number of unique paths to the destination.
Leetcode 64: Minimum Path Sum
Given an m x n grid filled with non-negative integers, find a path from the top-left to the bottom-right corner that minimizes the sum of all numbers along the way. The robot can only move either right or down at each step.
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 72: Edit Distance
Given two strings str1 and str2, your task is to determine the minimum number of operations required to transform str1 into str2. The allowed operations are: Insert a character, Delete a character, and Replace a character.
Leetcode 91: Decode Ways
You have intercepted a string of numbers that encodes a message. The message is decoded using the following mapping:
“1” -> ‘A’, “2” -> ‘B’, … “26” -> ‘Z’.
However, there are multiple ways to decode the string, as some numbers can represent a single letter (e.g., ‘1’ for ‘A’, ‘12’ for ‘L’). Your task is to return the number of possible ways to decode the string. Note that strings containing invalid encodings (e.g., starting with zero or having codes larger than 26) should not be considered valid.