- 博客(317)
- 资源 (19)
- 收藏
- 关注

原创 javascript
基础语法jqery的一些zencode http://docs.emmet.io/abbreviations/syntax/ 数据类型以及控制元素未定义的判断() if(typeof(sentiment)!=”undefined”){}布尔判断 小写的 true 和false强制字符串转数字,int parseInt(stringnum); 对象var obj={}; obj.tex
2016-03-22 21:25:26
697

原创 Python的基础函数
python 开发文档镇楼。 https://docs.python.org/2/index.html关于代码python的合理布局(1)起始行 (2) 模块文档 (3)模块导入 (4)变量定义 (5)类定义 (6)函数定义 (7)主程序文档编码#encoding: utf-8 # 设置系统编码 import codecs codecs.open("loc,txt","w","ut
2016-03-06 15:55:36
763

原创 自然语言处理
好像有时候会用到自然语言处理。包括一些概念性东西和知识整理。知乎上面整理的自然语言入门的知识贴http://www.zhihu.com/question/19895141coursera上面有一个哥伦比亚https://www.coursera.org/course/nlangp这里介绍自然语言处理的应用在于语言的自动翻译,人机对话,信息提取(从非结
2015-11-07 14:33:51
1698

原创 C++一些函数 备用
http://baike.baidu.com/link?url=eikMzuoUH9_OOD_Z4ov-JdcAdv2bMse_eWBLjRuL5IH9ggR-AgMng2SI7GiLHQuzQWiRmetaKECksoq-TLoX8afind_first_not_ofhttp://blog.sina.com.cn/s/blog_453a02280100r8tv.html 字
2014-01-12 19:15:12
1519
原创 [编程题] 偶数大翻转
今天的计算机课上,老师给同学们出了一道题: 输入n个数,请将其中的偶数的二进制反转。 eg:输入1 6 5 其中6是偶数,二进制表示为110,反转后为011,代表3,所以最终输出1 3 5. 小贱君最近脑子不怎么好使,想了半天也没想出来如何做,最后他向你寻求帮助了,帮帮可怜的小贱君吧!输入描述:输入包含多组测试数据。对于每组测试数据:N — 输入的数字个数N个数:a0,a1,…,an-1保证
2016-08-06 12:38:43
1240
原创 【leetcode】36. Valid Sudoku
36. Valid SudokuDetermine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.主要是mask可以减少内存存储,
2016-07-30 16:43:49
706
原创 【leetcode】53. Maximum Subarray
53. Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subar
2016-07-17 16:45:53
577
原创 【leetcode】63. Unique Paths II
Follow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For ex
2016-07-17 13:47:40
454
原创 【leetcode】110. Balanced Binary Tree
Given 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 of every node never differ by
2016-07-16 13:46:43
368
原创 【leetcode】66. Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.class Solution {public:
2016-07-16 12:12:15
413
原创 【leetcode】46. Permutations
Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2
2016-07-15 11:33:48
311
原创 C++一些函数 备用 markdown
cppreference输入输出 重定向 freopen(“input.txt”, “r”, stdin); 整行输入string a;#include<iostream> getline(cin, a); 因为那个啥超时的原因,需要C语言 char a[100];includeincludestring c; getline(cin,c); cin输入字母和数字int a[3],
2016-07-15 10:56:38
890
原创 【leetcode】62. Unique Paths
class Solution {private: int backtrack(int r,int c,int m,int n){ if(r==m-1&&c==n-1){ return 1; } if(r>=m||c>=n){ return 0; } return b
2016-07-15 10:45:46
300
原创 【leetcode】28. Implement strStr()
第一种,javascript原生态函数,108ms/** * @param {string} haystack * @param {string} needle * @return {number} */var strStr = function(haystack, needle) { return haystack.indexOf(needle);};第二种,朴素字符串匹配
2016-07-15 10:39:57
429
原创 【leetcode】27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The order
2016-07-08 09:53:01
375
原创 【leetcode】26. Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with cons
2016-07-07 11:53:29
332
原创 【leetcode】25. Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.You
2016-07-06 15:29:15
294
原创 【leetcode】23. Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * thi
2016-07-06 13:50:43
262
原创 【leetcode】24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example, Given1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may not
2016-07-05 19:40:28
328
原创 【leetcode】21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * function ListNo
2016-07-05 10:36:31
293
原创 【leetcode】20. Valid Parentheses
Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all valid but “
2016-07-05 10:34:29
336
原创 【leetcode】19. Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linke
2016-07-04 20:07:26
266
原创 【leetcode】17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string “23
2016-07-04 12:33:52
288
原创 【leetcode】16. 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly
2016-07-04 11:57:06
256
原创 【leetcode】15. 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain duplic
2016-07-03 20:31:02
388
原创 【leetcode】14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings./** * @param {string[]} strs * @return {string} */var longestCommonPrefix = function(strs) { var ll = strs.
2016-07-03 10:51:44
285
原创 【leetcode】11. 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 two lin
2016-07-03 10:15:42
256
原创 【leetcode】10. 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 i
2016-07-02 20:03:31
388
原创 【leetcode】9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space./** * @param {number} x * @return {boolean} */var isPalindrome = function(x) { var num = x; var reverse = 0; wh
2016-06-30 13:20:31
214
原创 【leetcode】5. 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. 最长回文字串,这个是暴力解法。/** * @pa
2016-06-27 10:34:39
239
原创 【leetcode】4. Median of Two Sorted Arrays
leetcod There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1: nums1 = [
2016-06-24 10:43:40
413
原创 【leetcode】6. ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I
2016-06-22 12:57:44
586
原创 【leetcode】3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the le
2016-06-22 11:01:43
279
原创 【leetcode】2. Add Two Numbers
不能只刷简单题了。从头开始刷,也算加大强度吧。You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers a
2016-06-20 19:21:13
274
原创 【leetcode】sql练习
以前数据库没有好好上,补一下这方面的基础知识。175. Combine Two TablesTable: Person +————-+———+ | Column Name | Type | +————-+———+ | PersonId | int | | FirstName | varchar | | LastName | varcha
2016-06-20 19:14:00
1426
原创 【leetcode】350. Intersection of Two Arrays II
Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Your runtime beats 38.36% of javascriptsubmissions/** * @param {n
2016-06-19 08:36:44
339
原创 【leetcode】1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example: Given nums = [2, 7, 11
2016-06-17 11:03:46
276
原创 【leetcode】121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), desi
2016-06-15 19:39:17
333
原创 【leetcode】318. Maximum Product of Word Lengths My Submissions QuestionEditorial Solution
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 lette
2016-06-14 10:55:20
343
原创 【leetcode】96. Unique Binary Search Trees
动态规划问题入门,分解成左右两颗子树。 Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2
2016-06-10 13:33:17
296
sentiwords情感词
2015-11-24
图片批量下载
2015-01-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人