- 博客(252)
- 资源 (1)
- 收藏
- 关注
原创 在一台机器上安装多个mysql
先给两个链接:http://blog.youkuaiyun.com/evkj2013/article/details/12945527https://my.oschina.net/qinmei/blog/611095这里有两个坑,我全踩了:1、database和database要写basedir=D:\\software\\mysql\\mysql-5.7.17-winx64-3
2017-03-27 22:17:15
530
1
原创 记在拿到cvte的offer之后
很久没有更新博客了,因为之前忙着找工作,然后很多笔记老是翻博客,感觉没有效率,于是就写在文档里,那样看起来更方便。这边博客记录下最近我找工作的时间所遇到的坑吧。首先阿里、腾讯内推简历被刷,相当不爽,但是很多原因也是自己造成的吧。1、没有写好简历一定不要着急投,不然会很惨。人家把你还没写好的简历看了直接就丢到简历池中,估计看都不会再看了,你就算后面修改也没什么卵用。2、要内推一定要找
2017-03-27 21:52:06
19543
原创 Largest Number
Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is9534330.Note: The result may be very
2016-11-10 22:25:48
515
原创 Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 if the array contains less than 2 elements.Y
2016-11-10 21:17:36
495
原创 Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".这里注意将一段文本分割成单词的时候要用s.trim().split("\\s+");public class Solution {
2016-11-09 17:23:10
445
转载 动态代理proxy与CGLib的区别
昨天被人问及动态代理与CGlib的区别,赶紧回顾一下:什么是代理?静态代理与动态代理静态代理实例JDK动态代理实例CGLib 简介CGLib 与JDK动态代理的区别 代理模式是Java中常见的一种模式,英文名字叫走Proxy或者Surrogate,代理的本意是一个人代表另一个人,或者一个机构代表另一个机构,采取行动,因而,代理和现实生活中的中介有很大的类似,你买房子、卖房子,可以
2016-10-15 10:36:32
459
原创 最大的奇约数
小易是一个数论爱好者,并且对于一个数的奇数约数十分感兴趣。一天小易遇到这样一个问题: 定义函数f(x)为x最大的奇数约数,x为正整数。例如:f(44) = 11.现在给出一个N,需要求出 f(1) + f(2) + f(3).......f(N)例如: N = 7 f(1) + f(2) + f(3) + f(4) + f(5) + f(6) + f(7) = 1 + 1 + 3 +
2016-10-11 17:08:14
454
原创 暗黑字符串
题目:一个只包含'A'、'B'和'C'的字符串,如果存在某一段长度为3的连续子串中恰好'A'、'B'和'C'各有一个,那么这个字符串就是纯净的,否则这个字符串就是暗黑的。例如:BAACAACCBAAA 连续子串"CBA"中包含了'A','B','C'各一个,所以是纯净的字符串AABBCCAABB 不存在一个长度为3的连续子串包含'A','B','C',所以是暗黑的字符串你的任务就是
2016-10-11 15:56:52
701
原创 网易2017校招编程:跳石板
小易来到了一条石板路前,每块石板上从1挨着编号为:1、2、3.......这条石板路要根据特殊的规则才能前进:对于小易当前所在的编号为K的石板,小易单次只能往前跳K的一个约数(不含1和K)步,即跳到K+X(X为K的一个非1和本身的约数)的位置。 小易当前处在编号为N的石板,他想跳到编号恰好为M的石板去,小易想知道最少需要跳跃几次可以到达。例如:N = 4,M = 24:4->6->
2016-10-10 17:12:09
528
原创 Contains Duplicate III
题目描述:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] andnums[j] is at most t and the difference betwee
2016-10-09 16:31:05
290
原创 Basic Calculator II
Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces. The integer division should
2016-10-08 19:57:23
370
原创 Different Ways to Add Parentheses
Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are+, - and *.Example 1I
2016-10-08 17:33:23
353
原创 Single Number
Single NumberGiven an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it wi
2016-10-08 16:46:09
300
原创 Remove Duplicate Letters
题目描述:Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographica
2016-10-07 20:06:23
392
转载 Expression Add Operators
Given a string that contains only digits 0-9 and a target value, return all possibilities to addbinary operators (not unary) +, -, or * between the digits so they evaluate to the target value.Ex
2016-10-05 21:21:46
397
原创 Data Stream as Disjoint Intervals
Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals.For example, suppose the integers from the data stream are
2016-10-05 17:25:13
384
原创 Top K Frequent Elements
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].Note: You may assume k is always valid, 1 ≤ k ≤ number of u
2016-10-05 15:40:44
318
原创 Power of Four
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 you solve it without loop
2016-09-19 22:01:12
266
原创 Flatten Nested List Iterator
Given a nested list of integers, implement an iterator to flatten it.Each element is either an integer, or a list -- whose elements may also be integers or other lists.Example 1:Given the list [
2016-09-19 21:29:43
395
原创 Self Crossing
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 to the east and so on
2016-09-18 17:03:37
482
原创 Increasing Triplet Subsequence
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 such that arr[i] arr[j]
2016-09-18 11:38:43
226
原创 Design Twitter
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user's news feed. Your design should support the fo
2016-09-17 21:59:38
271
原创 Reconstruct Itinerary
Given a list of airline tickets represented by pairs of departure and arrival airports[from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs fromJFK. Thus,
2016-09-13 18:45:21
439
原创 Verify Preorder Serialization of a Binary Tree
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 value such as#.
2016-09-13 16:03:34
309
原创 Patching Array
Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range[1, n] inclusive can be formed by the sum of some elements in the array. Ret
2016-09-12 20:17:49
427
原创 Longest Increasing Path in a Matrix
Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside o
2016-09-11 16:02:28
278
原创 Wiggle Sort II
Given an unsorted array nums, reorder it such that nums[0] nums[2] .Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6].(2) Given nums = [1, 3, 2, 2, 3, 1],
2016-09-09 18:48:26
275
原创 Maximum Product of Word Lengths
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case lett
2016-09-08 19:41:04
276
原创 Valid Perfect Square
Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt.Example 1:Input: 16Return
2016-09-07 18:36:28
209
原创 Insert Delete GetRandom O(1) - Duplicates allowed
Design a data structure that supports all following operations in averageO(1) time.Note: Duplicate elements are allowed.insert(val): Inserts an item val to the collection.remove(val): Removes
2016-09-07 17:10:19
253
原创 Insert Delete GetRandom O(1)
Design a data structure that supports all following operations in averageO(1) time.insert(val): Inserts an item val to the set if not already present.remove(val): Removes an item val from the se
2016-09-07 15:37:50
282
原创 Decode String
Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactlyk times. Note that k is gu
2016-09-06 15:05:31
564
原创 Longest Substring with At Least K Repeating Characters
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character inT appears no less than k times.Example 1:Input:s = "aaabb", k = 3
2016-09-06 13:20:37
1353
原创 Find K Pairs with Smallest Sums
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integerk. Define a pair (u,v) which consists of one element from the first array and one element from the second a
2016-09-05 17:34:59
331
原创 Guess Number Higher or Lower
题目描述:We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number i
2016-09-02 17:28:19
238
原创 Combination Sum IV
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.Example:nums = [1, 2, 3]target = 4The possi
2016-09-02 15:33:59
245
原创 Linked List Random Node
题目描述:Given a singly linked list, return a random node's value from the linked list. Each node must have thesame probability of being chosen.Follow up:What if the linked list is extremely lar
2016-08-31 17:08:30
279
原创 Kth Smallest Element in a Sorted Matrix
题目描述:Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted ord
2016-08-31 16:40:34
955
原创 Lexicographical Numbers
题目描述:Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorithm to use less time and space. The inp
2016-08-30 10:43:48
1242
原创 java反射
许多java对象在运行时表现出两种状态:编译时类型和运行时类型。例如:Person p = new Student();为了解决这个问题,需要知道该对象运行时类型的方法。第一种做法是假设在编译时和运行时完全知道类型的真实信息,这就可以用instanceof进行判断,然后利用强制类型转换将其转换成其运行时类型的变量。第二种做法是编译时完全不知道这个对象可能属于哪些类,这时就必须要利用反射
2016-08-28 16:07:30
565
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人