All Posts

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 648: Replace Words

In English, certain words can be formed by adding a suffix to a root word. Given a list of root words and a sentence, replace every word in the sentence that is a derivative of any root word with the shortest root. If a word can be formed by more than one root, replace it with the shortest root.

Leetcode 649: Dota2 Senate

In a Senate made up of senators from two parties, Radiant and Dire, senators can either ban another senator from voting or announce victory if only one party remains with active senators. Predict which party will announce the victory and change the game.

Leetcode 676: Implement Magic Dictionary

Design a data structure that supports searching for words that can be matched by changing exactly one character.

Leetcode 677: Map Sum Pairs

Design a map-like data structure that supports key-value insertion and sum queries for keys starting with a specific prefix.

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.