原创 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 th

原创 LintCode_198 Permutation Index II

Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, w

原创 LintCode_192 Wildcard Matching

Implement wildcard pattern matching with support for '?' and'*'. '?' Matches any single character.'*' Matches any se

原创 LintCode_365 Count 1 in Binary

Count how many 1 in binary representation of a 32-bit integer. Example Given 32, return 1 Given 5, return 2 Giv

原创 LintCode_134 LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations

原创 LintCode_190 Next Permutation II

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.

原创 LintCode_564 Backpack VI

Given an integer array nums with all positive numbers and no duplicates, find the number of possible combinations t

原创 LintCode_191 Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product. Exam

原创 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. Y

原创 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

原创 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

原创 LintCode_154 Regular Expression Matching

Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches ze

原创 LintCode_223 Palindrome Linked List

Implement a function to check if a linked list is a palindrome. Example Given 1->2->1, return true Challenge 

原创 LintCode_189 First Missing Positive

Given an unsorted integer array, find the first missing positive integer. Example Given [1,2,0] return 3, and [3

原创 github/gitlab 管理多個ssh key

以前只使用一個 ssh key 在github上提交代碼,由於工作原因,需要再添加一個ssh key在公司的 gitlab上提交代碼,下面記錄下配置過程,防止遺忘。 說明下我的環境是 Win7 + msysgit + GitBash,