- 博客(103)
- 收藏
- 关注
原创 Duplicate问题
219.Contains Duplicate IIGiven an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and theabsolutedifference be...
2019-07-03 03:11:53
1460
原创 [二战]
686.Repeated String Matchclass Solution { public int repeatedStringMatch(String A, String B) { if(A == null || A.length() == 0 ) { return -1; } if(B...
2019-01-25 04:28:25
307
原创 [JSP] eclipse web project 发布到tomcat下
http://www.cnblogs.com/cxtczzy/archive/2013/03/30/2991096.html
2018-01-12 04:54:51
232
原创 [Postgre SQL] postgre sql
参考此tutorial:http://gitbook.net/postgresql/2013080439.html1. 直接打开SQL Shell (psql)2. 点回车直到如下1. create database database-name;2.列出所有database:\l4. 选择一个database: \c databas
2018-01-07 12:08:20
2274
原创 [Spring Boot] Spring Boot Actuator
前提:建好Spring Starting Project1. src/main/resources目录里的application.properties里加server.port: 9000management.port: 9001management.address: 127.0.0.1management.security.enabled=false
2018-01-06 23:54:00
397
原创 [spring Boot] how to package and run Spring Boot application as a JAR file
前提:进入到当前project的目录下1. mvn clean install2. java -jar target/文件名-0.0.1-SNAPSHOT.jar
2018-01-06 11:34:29
254
原创 [Spring]tomcat启动
cd apache-tomcat-9.0.2cd bin./catalina.sh run进入浏览器 http://localhost:8080/
2017-12-26 23:34:52
300
原创 [Spring MVC] What is my Spring MVC controller not working?
THIS IS AN ECLIPSE CACHING BUGIF YOUR CONTROLLER DOESN'T WORK THEN TRY THE STEPS BELOWBE SURE TO COME BACK TO THIS ARTICLEDebug Tip #0: Make sure you are accessing the correct URL
2017-12-21 11:50:32
264
原创 [Mongodb]mongodb import json
前提:要导入的json文件数据放在mongo/bin目录下,路径一定要放对cd mongo/bin./mongoimport -d db名称 -c collection名称 --jsonArray data.json结果:data.json里所有的内容都导入到了这个collection里,没有过滤掉
2017-12-02 04:42:29
626
原创 [Nodejs] nodemon:自动重启与页面刷新
前提:已经install nodemon到global,这里说如何使用nodemon代替node例如文件路径 desktop/lab3,而且已经npm install好node-modules如果用node命令,要npm start如果用nodemon,要nodemo --exec ‘npm start'而且在程序输出完毕后显示如下,等待程序更新,然后这边自
2017-11-02 03:51:06
6138
原创 [Git] Git出现一些错误的解决方法
1. Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm ' as appropriate to mark resolution, or use 'git commit -a'
2017-10-04 09:16:41
2100
原创 [Git] Git初应用
条件:在gitHub上已经创建了新的repository:Web-Programming,并且创建的同时initialize this repository with a READMEAdd .gitignore: NodeAdd a license: MIT然后自己的air根目录下有Web-Programming这个文件夹,把要上传到gitHub Web-Programmi
2017-10-02 00:19:23
326
原创 [US Giants] 十. Data Structure
Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.Clarification: Your algorithm should run in O(n) complexit
2017-09-26 23:23:34
369
原创 [MongoDB] Mongodb的初应用
前提:下载好mongodb,然后把下载下来的文件夹改为mongo,并将文件夹移到自己用的地方,在同一个路径下创建mongo-data文件夹要做:初次连接并小测试下mongodb当初次设置成功后,以后用只要按照如下即可
2017-09-25 00:02:02
306
原创 [Nodejs] Debug-Chrome Dev Tools
现状:桌面上的notes-node文件里有个playground文件夹,里面有一个debugging.js文件,要debug这个文件然后在chrome里输入:chrome://inspect跳转:点击后结果:
2017-08-31 06:50:17
391
原创 [Nodejs] Debug-Ternimal
现状:桌面上的notes-node文件里有个playground文件夹,里面有一个debugging.js文件,要debug这个文件命令c是继续,命令n是下一行,如果提前在文件中打入debugger;这个时候debug的话输入命令c会直接到debugger这边,更便捷更快一些命令repl是切换到可以看参数的具体情况的时候,例如输入person什么的想要退出:control+c
2017-08-31 06:15:49
399
原创 [Nodejs] npm
要在当前的路径下:notes-node最后文件夹notes-node里多出node_modules文件夹,以及package-lock.json和package.json
2017-08-30 06:41:28
310
原创 [leetCode] 369. Plus One Linked List
Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 it
2017-08-24 05:14:01
351
原创 [MySQL] case问题
Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update query and no intermedia
2017-08-19 05:34:37
369
原创 [US Giants] 八. Search & Recurison
Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizonta
2017-08-18 01:47:39
443
原创 [US Giants] 七. Binary Tree
Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees
2017-08-09 09:45:52
371
原创 [Project] Online Notes App
boostrap模板:getboostrapnavbar generator:twitter bootstrap navbar generator
2017-08-03 00:51:55
335
原创 [US Giants] 六. Linked List
Remove Nth Node From End of ListGiven a linked list, remove the nth node from the end of list and return its head.The minimum number of nodes in list is n.ExampleGi
2017-07-31 10:54:04
334
原创 [US Giants] 五. Greedy
Single NumberGiven 2*n + 1 numbers, every numbers occurs twice except one, find it.Example:Given [1,2,2,1,3,4,3], return 4Challenge :One-pass, constant extra space.思路:HashMap
2017-07-29 00:30:25
345
原创 [US Giants] 四.Math & Bit Manipulation
Trailing ZerosWrite an algorithm which computes the number of trailing zeros in n factorial.Example11! = 39916800, so the out should be 2Challenge O(log N) time思路
2017-07-27 10:05:49
425
原创 [US Giants] 三. Binary Search
Sqrt(x) :点击打开链接Implement int sqrt(int x).Compute and return the square root of x.Examplesqrt(3) = 1sqrt(4) = 2sqrt(5) = 2sqrt(10) = 3Challenge O(log(x))cl
2017-07-26 09:54:47
330
原创 [Algorithm] Rotate 问题
Rotate StringGiven a string and an offset, rotate string by offset. (rotate from left to right)Have you met this question in a real interview? YesExampleGiven "abcdef
2017-07-25 02:52:12
348
原创 [US Giants] 二. Integer-Array
50. Product of Array Exclude Itself点击打开链接思路:两趟循环,对于每一个output[i]={i前面的数的乘积}*{i后面的数的乘积} 第一趟正向遍历数组,对于每个Xi计算Xo~Xi-1的连续乘积 第二趟反向遍历数组,对于每个Xi计算Xn-1~Xi+1的连续乘积例如:A={2,3,4};
2017-07-23 09:59:56
367
原创 [US Giants] 一. String
Given two strings, find the longest common substring.Return the length of it. NoticeThe characters in substring should occur continuously in original string. This is different with subsequ
2017-07-20 06:18:47
627
原创 [高频] 六.数学,几何计算,位运算常见问题
38. Search a 2D Matrix II:点击打开链接[ [1, 3, 5, 7], [2, 4, 7, 8], [3, 5, 9, 10]]思路:从第一行最后一个元素(或者第一列最后一个元素)开始遍历,记此元素为x 如果x<target,砍掉第一行 如果x>target,砍掉最后一列 ...
2017-07-18 03:48:21
745
原创 [LeetCode] 191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 00000000
2017-07-18 03:34:03
310
原创 [Microsoft] Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix.This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each ro
2017-07-15 20:14:32
303
原创 [Microsoft] Find Peak Element
There is an integer array which has the following features:The numbers in adjacent positions are different.A[0] A[A.length - 1].We define a position P is a peek if:A[P] > A[P-1] && A[P] > A[P
2017-07-15 19:56:52
220
原创 [Microsoft] Identical Binary Tree
Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value.Example 1 1 / \
2017-07-15 19:54:28
244
原创 [Microsoft] Linked List Cycle
/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int val) { * this.val = val; * this.next = null; * } * } */ p
2017-07-15 19:51:44
190
原创 [Microsoft] O(1) Check Power of 2
Using O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return true;For n=5, return false;思路:2的幂次方(2^n)的二进制表达法只有一位为1,其他位都为0,而(2^n-1)则是和(2^n)对应位置正好不一样
2017-07-15 03:43:04
428
原创 [Amazon] Continuous Subarray Sum
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and the index of the last number. (If their are duplic
2017-07-14 10:56:11
228
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人