All Posts

Leetcode 139: Word Break

Given a string s and a dictionary of words wordDict, return true if s can be segmented into a space-separated sequence of one or more words from the dictionary. The same word in the dictionary can be reused multiple times.

Leetcode 150: Evaluate Reverse Polish Notation

You are given an array of strings tokens that represents an arithmetic expression in Reverse Polish Notation (RPN). Your task is to evaluate the expression and return the result as an integer.

Leetcode 152: Maximum Product Subarray

You are given an integer array nums. Find the subarray that has the largest product, and return the product.

Leetcode 153: Find Minimum in Rotated Sorted Array

Given a sorted array of unique elements, rotated between 1 and n times, find the minimum element in this array.

Leetcode 162: Find Peak Element

You are given a list of integers, nums. A peak element is an element that is strictly greater than its neighbors. You need to find and return the index of any peak element in the list. The algorithm should run in O(log n) time.

Leetcode 167: Two Sum II - Input Array Is Sorted

Given a sorted array of integers, find two numbers whose sum equals a target value. Return the indices of these two numbers, ensuring they are 1-indexed.