随笔分类 - LeetCode
摘要:LeetCode刷题记录 传送门 Description Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If multiple answ
阅读全文
摘要:LeetCode刷题记录 传送门 Description In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has le
阅读全文
摘要:使用 Java 爬取 LeetCode 题目内容以及提交的AC代码 传送门 Description We have a set of items: the i-th item has value values[i] and label labels[i]. Then, we choose a sub
阅读全文
摘要:使用 Java 爬取 LeetCode 题目内容以及提交的AC代码 传送门 Description Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remainin
阅读全文
摘要:LeetCode刷题记录 传送门 Description An undirected, connected treewith N nodes labelled 0...N-1 and N-1 edges are given. The ith edge connects nodes edges[i][
阅读全文
摘要:以下使用LeetCodeCrawler自动生成 # Title Solution Acceptance Difficulty Topics 0001 Two Sum C++ Java 44.23% Easy Array | Hash Table 0002 Add Two Numbers C++ Ja
阅读全文
摘要:传送门 Description Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets i
阅读全文
摘要:传送门 Description Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the
阅读全文
摘要:传送门 Description Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which g
阅读全文
摘要:传送门 Description Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such th
阅读全文
摘要:传送门 Description Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structur
阅读全文
摘要:传送门 Description You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, )to get th
阅读全文
摘要:传送门 Description Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1
阅读全文
摘要:传送门 Description Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given nu
阅读全文
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to
阅读全文
摘要:传送门 Description Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n
阅读全文
摘要:传送门 Description Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find t
阅读全文
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers
阅读全文
摘要:传送门 Description Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear
阅读全文
摘要:传送门 Description Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb", the answer is "abc"
阅读全文