- 博客(14)
- 资源 (11)
- 收藏
- 关注
原创 JavaScript使用Window Location进行页面跳转
JavaScript使用Window Location进行页面跳转概述 在Web开发中,常有页面跳转的需要,跳转页面的方式也有很多种,不过这里仅介绍使用window.location的方法,这种方法既可以用于具有onclick事件的标签,也可以用于满足某些条件进行跳转,使用起来更方便更灵活一些。window.location window.location对象用于获得当前页面的地址(UR
2017-01-22 11:38:54 35816
原创 LeetCode OJ-78.Subsets
LeetCode OJ-78.Subsets题目描述 Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example, If nums = [1,2,3],
2017-01-17 15:33:22 480
原创 LeetCode OJ-77.Combinations
LeetCode OJ-77.Combinations题目描述 Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4]
2017-01-16 18:48:29 474
原创 LeetCode OJ-74.Search a 2D Matrix
LeetCode OJ-74.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
2017-01-16 09:24:38 583
原创 LeetCode OJ-64.Minimum Path Sum(DP)
LeetCode OJ-64.Minimum Path Sum(DP)题目描述 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note
2017-01-13 12:00:58 395
原创 LeetCode OJ-62. Unique Paths(DP)
LeetCode OJ-62. Unique Paths(DP)题目描述 A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in
2017-01-12 12:32:18 469
原创 LeetCode OJ-55.Jump Game
LeetCode OJ-55.Jump Game题目描述 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length
2017-01-09 11:54:07 382
原创 LeetCode OJ-53.Maximum Subarray(最大连续子数组和)
LeetCode OJ-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,
2017-01-07 11:29:27 1159
原创 LeetCode OJ-49.Group Anagrams
LeetCode OJ-49.Group Anagrams题目描述 Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: [ ["ate", "eat","tea"],
2017-01-07 10:45:26 542
原创 LeetCode OJ-46.Permutations(全排列问题)
LeetCode OJ-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
2017-01-06 17:00:48 597
原创 全排列生成算法
全排列生成算法概述 全排列问题,简单来说,就是由n个不同元素组成的序列,从中取出n个元素,按不同顺序排列起来。如:”123”,它的全排列为,”123”,”132”,”213”,”231”,”312”,”321”,总共有n!种结果。解法一:回溯法求解 对于求解所有可能情况的问题,回溯法不失为一种可以解决问题的方法。对于全排列生成,可以把序列的每一个字符作为一层,也可以说是,固定一个字符,对
2017-01-06 14:56:01 793
原创 LeetCode OJ-22.Generate Parentheses(回溯法)
LeetCode OJ-22.Generate Parentheses(回溯法)题目描述 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is:
2017-01-03 19:41:54 877
原创 LeetCode OJ-18.4Sum(四数和)
LeetCode OJ-18.4Sum(四数和)题目描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of t
2017-01-03 16:17:15 540
原创 LeetCode OJ-17.Letter Combinations of a Phone Number(DFS)
LeetCode OJ-17.Letter Combinations of a Phone Number(DFS解法)题目描述 Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just
2017-01-03 14:29:32 905
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人