LeetCode-3Sum

Given an integer array nums, return all the triplets numsi, numsj, numsk such that i != j, i != k, and j != k, and numsi + numsj + numsk == 0

2021-05-10 · 2 min · 278 words · Garlic Space

LeetCode-Two Sum

Given an array of integers nums and an integer target, return _indices of the two numbers such that they add up to target

2021-05-10 · 1 min · 188 words · Garlic Space

LeetCode-Palindrome Pairs Solution

Given a list of unique words, return all the pairs of the distinct indices i, j in the given list, so that the concatenation of the two words wordsi + wordsj is

2021-04-01 · 3 min · 477 words · Garlic Space

LeetCode-Word Search II Solution

Given an m x n board of characters and a list of strings words, return _all words on the board

2021-03-07 · 2 min · 318 words · Garlic Space

LeetCode-Maximum XOR of Two Numbers in an Array

Given an integer array nums, return the maximum result of numsi XOR numsj, where 0 ≤ i ≤ j < n

2021-02-27 · 2 min · 246 words · Garlic Space

LeetCode- Add and Search Word - Data structure design Solution

leetcode 211 Trie的添加及搜索

2021-01-27 · 5 min · 1015 words · Garlic Space

LeetCode- Replace Words Solution

题目: In English, we have a concept called root, which can be followed by some other word to form another longer word - let’s call this word successor. For example, when the root "an" is followed by the successor word "other", we can form a new word "another". Given a dictionary consisting of many roots and a sentence consisting of words separated by spaces, replace all the successors in the sentence with the root forming it. If a successor can be replaced by more than one root, replace it with the root that has the shortest length. ...

2021-01-12 · 4 min · 800 words · Garlic Space

LeetCode- Map Sum Pairs Solution

Implement a MapSum class with insert, and sum methods

2020-09-22 · 3 min · 448 words · Garlic Space

LeetCode – Populating Next Right Pointers in Each Node Solution

You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:

2020-09-07 · 3 min · 520 words · Garlic Space

LeetCode –Populating Next Right Pointers in Each Node II

Given a binary tree

2020-09-07 · 3 min · 532 words · Garlic Space