随笔分类 -  LeetCode

摘要:LeetCode刷题记录 传送门 Description Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If multiple answ 阅读全文
posted @ 2019-06-18 09:57 zxzhang 阅读(506) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-06-18 09:49 zxzhang 阅读(626) 评论(0) 推荐(0) 编辑
摘要:使用 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 阅读全文
posted @ 2019-06-18 09:42 zxzhang 阅读(532) 评论(0) 推荐(0) 编辑
摘要:使用 Java 爬取 LeetCode 题目内容以及提交的AC代码 传送门 Description Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remainin 阅读全文
posted @ 2019-06-18 09:29 zxzhang 阅读(955) 评论(0) 推荐(0) 编辑
摘要: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][ 阅读全文
posted @ 2018-05-22 18:57 zxzhang 阅读(2033) 评论(0) 推荐(0) 编辑
摘要:以下使用LeetCodeCrawler自动生成 # Title Solution Acceptance Difficulty Topics 0001 Two Sum C++ Java 44.23% Easy Array | Hash Table 0002 Add Two Numbers C++ Ja 阅读全文
posted @ 2018-04-16 23:04 zxzhang 阅读(1040) 评论(4) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-12-31 10:13 zxzhang 阅读(206) 评论(1) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-12-30 19:18 zxzhang 阅读(235) 评论(2) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-12-30 19:04 zxzhang 阅读(219) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-12-29 15:29 zxzhang 阅读(185) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-09-30 15:28 zxzhang 阅读(204) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-09-30 15:27 zxzhang 阅读(1205) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-08-23 20:31 zxzhang 阅读(463) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-08-20 16:23 zxzhang 阅读(237) 评论(0) 推荐(0) 编辑
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to 阅读全文
posted @ 2017-08-20 16:14 zxzhang 阅读(217) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-08-19 23:22 zxzhang 阅读(253) 评论(0) 推荐(0) 编辑
摘要:传送门 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 阅读全文
posted @ 2017-08-19 17:45 zxzhang 阅读(247) 评论(0) 推荐(0) 编辑
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers 阅读全文
posted @ 2017-08-15 10:45 zxzhang 阅读(158) 评论(0) 推荐(0) 编辑
摘要:传送门 Description Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear 阅读全文
posted @ 2017-08-15 00:15 zxzhang 阅读(233) 评论(0) 推荐(0) 编辑
摘要:传送门 Description Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb", the answer is "abc" 阅读全文
posted @ 2017-08-14 17:19 zxzhang 阅读(172) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示