- 博客(12)
- 资源 (1)
- 问答 (3)
- 收藏
- 关注
原创 LeetCode Russian Doll Envelopes
Description:You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelop
2016-09-06 21:25:01 387
原创 LeetCode Intersection of Two Arrays II
Description:Given two arrays, write a function to compute their intersection.Solution:和上一个题目不同,这里需要输出所有交集的valimport java.util.*;public class Solution { public int[] intersect(int[]
2016-09-05 12:06:07 260
原创 LeetCode Intersection of Two Arrays
Description:Given two arrays, write a function to compute their intersection.Solution:用HashSetimport java.util.*;public class Solution { public int[] intersection(int[] nums1, int[] n
2016-09-05 10:27:12 219
原创 LeetCode Top K Frequent Elements
Description:Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Solution:感觉主要就是用HashMap和PriorityQueue。
2016-09-05 09:57:26 232
原创 LeetCode Reverse String
Description:Write a function that takes a string as input and returns the string reversed.Solution:学一下用法~~~public class Solution { public String reverseString(String s) { return new S
2016-09-05 09:27:03 219
原创 LeetCode Power of Four
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 num = 5, return false.Follow up: Could yo
2016-09-05 06:05:11 224
原创 LeetCode Counting Bits
Description:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Sol
2016-09-05 00:09:09 196
原创 LeetCode House Robber III
Description:The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent h
2016-09-04 23:25:51 217
原创 LeetCode Self Crossing
Description:You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south, x[3] metres
2016-09-04 13:38:31 233
原创 LeetCode Verify Preorder Serialization of a Binary Tree
Description:One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel valu
2016-09-04 05:58:22 243
原创 LeetCode Increasing Triplet Subsequence
Description:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:Return true if there exists i, j, k s
2016-09-04 00:32:28 249
原创 LeetCode Odd Even Linked List
Description:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You shou
2016-09-03 23:06:28 240
java中的sql语句为何会报错,而到了workbench就可以执行
2015-03-17
Python获得网卡IP的几个参数问题
2015-01-12
Python中注释前面加上引号是什么意思?
2014-12-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人