- 博客(161)
- 资源 (1)
- 收藏
- 关注
原创 Spark 2.0 + kafka 0.10 fullstack 实战小记(1)
最近开搞spark streaming,记录下一个apache log analysis demo的部署过程。开发环境是Mac os + scala 2.11 + spark 2.0 + kafka 0.10 + Intellij Idea。安装 scala(如果已经安装完毕就跳过) Mac os系统下使用 brew安装 ,为确保版本问题, 先运行
2016-08-30 11:40:21
5428
原创 LintCode_510 Maximal Rectangle
Given a 2D boolean matrix filled with False and True, find the largest rectangle containing all True and return its area.Have you met this question in a real interview? YesExam
2016-08-21 14:13:28
654
原创 LintCode_400 Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Return 0 if the array contains less than 2 elements. NoticeYou may assume all elemen
2016-08-21 08:42:25
386
原创 LintCode_383 Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate(i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and(i, 0). Find
2016-08-21 04:50:51
280
原创 LintCode_249 Count of Smaller Number before itself
Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) . For each element Ai in the array, count the number of element before this element Ai is
2016-08-20 03:04:29
322
原创 LintCode_248 Count of Smaller Number
Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you an integer, return the number of element in the ar
2016-08-20 02:59:34
327
原创 LintCode_212 Space Replacement
Write a method to replace all spaces in a string with %20. The string is given in a characters array, you can assume it has enough space for replacement and you are given the true length of the stri
2016-08-20 02:55:14
440
转载 LintCode_393 Best Time to Buy and Sell Stock IV
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most k transactions.Note:You may no
2016-08-19 09:47:14
318
原创 LintCode_430 Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr
2016-08-19 06:34:49
296
转载 Install and config Redis on Mac OS X via Homebrew
By using Homebrew, you greatly reduce the cost of setting up and configuring the development environment on Mac OS X.Let’s install Redis for the good.$ brew install redisAfter installation
2016-08-18 03:50:40
380
原创 MAC系统安装配置mysql (authentication_string这个坑啊)
今天搞node.js, 好不容易来连个数据库玩玩,结果尼玛死活连不上去,后来发现是足迹的mysql没装,黑线了~~~具体安装过程如下:1. 安装MySQL;2. 安装MySQL Workbench;3. 打开后死活要密码,我还没设置捏~~4. 苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务5: Start it in safe mode
2016-08-17 13:53:58
8174
转载 Lintcode_417 Valid Number
Validate if a given string is numeric.Have you met this question in a real interview? YesExample"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true
2016-08-17 03:15:45
301
原创 LintCode_208 Assignment Operator Overloading (C++ Only)
Implement an assignment operator overloading method.Make sure that:The new data can be copied correctlyThe old data can be deleted / free correctly.We can assign like A = B = CHave you met
2016-08-16 06:45:32
355
原创 LintCode_205 Interval Minimum Number
Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each query, calculate the minimum number between ind
2016-08-16 06:42:39
258
原创 LintCode_362 Sliding Window Maximum
Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find the maximum number inside the window at each moving.
2016-08-16 04:59:28
294
原创 LintCode_552 Create Maximum Number
Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of lengthk from digits of the two. The relative order of the digits from the same array mu
2016-08-16 04:05:25
291
转载 LintCode_412 Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on
2016-08-15 14:34:04
343
原创 LintCode_207 interval-sum-ii
Given an integer array in the construct method, implement two methods query(start, end) and modify(index, value):For query(start, end), return the sum from index start to index end in the given
2016-08-15 14:24:04
225
原创 MEAN_fullstack 开发日记(1)
醉经做全栈开发, 要在局域网测试下就用到了ngrok:首先用npm安装 npm install ngrok -g然后开始服务(8080是端口号, 可以改动)ngrok http 8080enjoy!!!!!
2016-08-14 15:48:23
299
原创 LintCode_192 Wildcard Matching
Implement wildcard pattern matching with support for '?' and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover
2016-08-09 14:20:33
338
原创 LintCode_131 Building Outline
Given N buildings in a x-axis,each building is a rectangle and can be represented by a triple (start, end, height),where start is the start position on x-axis, end is the end position on x-axis and
2016-08-09 11:02:01
343
原创 LintCode_366 Fibonacci
Find the Nth number in Fibonacci sequence.A Fibonacci sequence is defined as follow:The first two numbers are 0 and 1.The i th number is the sum of i-1 th number and i-2 th number.The first te
2016-08-08 02:32:15
343
2
原创 LintCode_134 LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if
2016-08-07 04:14:43
370
转载 github/gitlab 管理多个ssh key
以前只使用一个 ssh key 在github上提交代码,由于工作原因,需要再添加一个ssh key在公司的 gitlab上提交代码,下面记录下配置过程,防止遗忘。说明下我的环境是 Win7 + msysgit + GitBash, 相信 *nux + bash 也是同样的道理。生成并添加第一个ssh key第一次使用ssh生成key,默认会在用户~(根目录)下生成 id_rs
2016-08-06 14:21:51
216
原创 LintCode_168 Burst Balloons
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get
2016-08-06 12:53:49
438
原创 LintCode_564 Backpack VI
Given an integer array nums with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. NoticeThe different sequences ar
2016-08-06 10:24:07
860
原创 LintCode_365 Count 1 in Binary
Count how many 1 in binary representation of a 32-bit integer.ExampleGiven 32, return 1Given 5, return 2Given 1023, return 9Challenge If the integer is n bits with m 1 bi
2016-08-04 04:48:36
305
原创 LintCode_362 Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.ExampleGiven [0,1,0,2,1,0,1,3,2,1,
2016-08-04 04:45:28
225
原创 LintCode_249 Count of Smaller Number before itself
Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) . For each element Ai in the array, count the number of element before this element Ai is
2016-08-04 04:41:23
402
原创 LintCode_223 Palindrome Linked List
Implement a function to check if a linked list is a palindrome.ExampleGiven 1->2->1, return trueChallenge Could you do it in O(n) time and O(1) space?找到中间点, 然后开始检查:/*
2016-08-04 04:26:39
173
原创 LintCode_204 Singleton
Singleton is a most widely used design pattern. If a class has and only has one instance at every moment, we call this design as singleton. For example, for class Mouse (not a animal mouse), we shou
2016-08-04 04:21:53
210
原创 LintCode_200 Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.ExampleG
2016-08-04 04:11:16
242
原创 LintCode_198 Permutation Index II
Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, which are ordered in lexicographical order. The index begins at 1.ExampleGi
2016-07-30 15:04:48
1296
原创 LintCode_191 Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.ExampleFor example, given the array [2,3,-2,4], the contiguous subarray [2,3]
2016-07-30 04:47:36
237
原创 LintCode_190 Next Permutation II
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o
2016-07-30 04:43:12
232
原创 LintCode_189 First Missing Positive
Given an unsorted integer array, find the first missing positive integer.ExampleGiven [1,2,0] return 3,and [3,4,-1,1] return 2.Challenge Your algorithm should run in O(n) tim
2016-07-30 04:37:33
228
原创 LinCode_187 Gas Station
There are N gas stations along a circular route, where the amount of gas at station i isgas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its
2016-07-30 04:33:54
225
原创 LintCode_154 Regular Expression Matching
Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st
2016-07-30 04:12:59
296
原创 leecode_229 Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.这样的元素最多两个//solution from bernin
2016-07-26 02:22:20
203
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人