258 – Add Digits My Submissions Question Editorial Solution Total Accepted: 101723 Total Submissions: 20…
Leetcode 93.Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For…
Leetcode 76. Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in co…
Leetcode 166. Fraction to Recurring Decimal
Given two integers representing the numerator and denominator of a fraction, return the fraction in string for…
Leetcode 223. Rectangle Area
Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bott…
Leetcode 161. One Edit Distance
Given two strings S and T, determine if they are both one edit distance apart. 思路: 两个字符串是否只通过一步变换(替换、删除、增加)就变成…
Leetcode 133. Clone Graph
屏幕快照 2017-10-21 下午1.59.01.png 题意:克隆一个无向图。 思路: 因为是克隆所以需要一个map来存储克隆的映射关系,我们可以从给定的第一个节点向它的neighbor一直搜索下去。 如果map的k…
679. 24 Game
You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *…
Leetcode 207. Course Schedule
There are a total of n courses you have to take, labeled from 0 to n – 1. Some courses may have prerequi…
Leetcode 42. Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much…
Leetcode 137.Single Number II
Given an array of integers, every element appears three times except for one, which appears exactly once. Find…
Leetcode 208. Implement Trie (Prefix Tree)
Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist…