LeetCode Intersection of Two Arrays DescriptionGiven two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result must be unique. The resul 1月 23 2017 #leetcode
LeetCode Verify Preorder Serialization of a Binary Tree DescriptionOne 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 value such 1月 23 2017 #leetcode
LeetCode Two Sum II Input array is sorted DescriptionGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the tw 1月 19 2017 #leetcode
LeetCode Top K Frequent Elements DescriptionGiven 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].Note: You may assume k is always valid, 1 ≤ k ≤ number of 1月 19 2017 #leetcode
LeetCode Longest Palindrome DescriptionGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for example “Aa” is 1月 19 2017 #leetcode
LeetCode Battleships in a Board DescriptionGiven an 2D board, count how many different battleships are in it. The battleships are represented with ‘X’s, empty slots are represented with ‘.’s. You may assume the following rules: You 1月 19 2017 #leetcode
LeetCode Magical String DescriptionA magical string S consists of only ‘1’ and ‘2’ and obeys the following rules: The string S is magical because concatenating the number of contiguous occurrences of characters ‘1’ and ‘2’ g 1月 19 2017 #leetcode
LeetCode Island Perimeter DescriptionYou are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is 1月 11 2017 #leetcode
LeetCode Hamming Distance DescriptionThe Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note:0 ≤ x, y 1月 10 2017 #leetcode
启动tomcat报错 “Cannot allocate memory (errno=12)”解决方法 问题启动tomcat statup.sh,直接报错了: VM warning: …… error=’Cannot allocate memory’ (errno=12)。 就是说内存不够了,查看了下内存还剩余大约1GB,但是对于要启动的程序是够的。 网上查找了一些资料,断定是Java VM的内存分配问题。 JVM初始分配的内存由-Xms指定,默认是物理内存的1/64;JVM最大分配的内存由-Xmx 1月 6 2017 #计算机 #Java