String Compression – 443. LeetCode

The “String Compression” problem requires reducing the size of a character array by compressing consecutive repeating characters into a single character followed by their count. For example, the [“a”, “a”, “b”, “b”, “b”, “c”] should be compressed to [“a”, “2”, “b”, “3”, “c”]. The challenge is to perform this compression…

read more

Insert Interval – 56. LeetCode

The Insert Interval problem involves inserting a new interval into a sorted list of non-overlapping intervals and merging any overlapping intervals. Think of it like scheduling a new meeting in a calendar: you add the meeting and merge it with existing ones if they overlap, ensuring the schedule remains clean…

read more

N-Queens – 51. LeetCode

The N-Queens problems asks us to place N queens on an N * N chessboard such that no two queens threaten each other. The means no two queens can bin the the same row, column, or diagonal. The challenge is to find all possible configurations of the board that satisfy…

read more

Valid Anagram – 242. Leetcode

An anagram is a word or phrase formed by rearranging the letters of another word or phrase. For example, “listen” and “silent” are anagrams. This problem asks you to determine if two given strings are anagrams of each other, but it should also work with Unicode characters like emojis or…

read more