freeCookie


freeCookie_🍪

LC32. Longest Valid Parentheses

LC32. Longest Valid Parentheses Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) pare...

LC174. Dungeon Game

LC174. Dungeon Game The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M...

LC115. Distinct Subsequences

LC115. Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a...

Leetcode - Strobogrammatic Number

LC246, LC247, LC248

LC246. Strobogrammatic Number A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a ...

Leetcode - Permutation problems

LC31, LC46, LC47, LC60, LC266, LC267

LC31. Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If su...

Leetcode - NQueens Problems

LC51, LC52

LC51. N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an int...

LC439. Ternary Expression Parser

LC439. Ternary Expression Parser Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You c...

LC37. Sudoku Solver

Solve a Sudoku puzzle

LC37. Sudoku Solver Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may...