All Posts

Leetcode 646: Maximum Length of Pair Chain

You are given an array of pairs where each pair represents an interval with two integers. A pair can follow another pair if the second integer of the first pair is less than the first integer of the second pair. Your task is to determine the length of the longest chain that can be formed by linking the pairs.

Leetcode 647: Palindromic Substrings

Given a string s, return the number of palindromic substrings in it. A palindrome is a string that reads the same forward and backward. A substring is a contiguous sequence of characters within the string.

Leetcode 673: Number of Longest Increasing Subsequence

Given an integer array nums, return the number of distinct longest increasing subsequences.

Leetcode 678: Valid Parenthesis String

Given a string consisting of ‘(’, ‘)’, and ‘’, determine if the string is valid according to the following rules. ‘’ can be treated as a left parenthesis, a right parenthesis, or an empty string.

Leetcode 688: Knight Probability in Chessboard

You are given an n x n chessboard and a knight that starts at a given position (row, column). The knight moves exactly k times and can randomly choose one of eight possible knight moves at each step. The task is to determine the probability that the knight remains on the board after completing all k moves.

Leetcode 698: Partition to K Equal Sum Subsets

Given an integer array nums and an integer k, your task is to determine if it is possible to divide this array into k non-empty subsets such that each subset has an equal sum.