解题点滴
波力海苔小小酥
工作内容:搬数据
展开
-
LeetCode----077. Combinations----Medium
2018.3.1 17:06 第一篇博客 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], [2,3], [1,2], ...原创 2018-03-01 17:46:11 · 122 阅读 · 0 评论 -
2017网易游戏雷火盘古实习生招聘笔试真题 推箱子
2018.3.19 此题我用了广度优先搜索(BFS)的方法.广度优先搜索不仅仅可以使用在图的遍历中,而且可以用于求解复杂问题的最优解。引子gnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,...原创 2018-03-19 20:08:51 · 685 阅读 · 0 评论 -
LeetCode----301. Remove Invalid Parentheses----Hard
2018.3.25 Spring is coming Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than ...原创 2018-03-25 17:39:54 · 136 阅读 · 0 评论 -
LeetCode 31 . Next Permutation的理解
LeetCode 讨论区中有一种解法看上去比较清晰,但是一开始不是太容易理解,分享一下自己的理解.完成这道题分成3部分:1)找到应该增大的位置i2)将nums[i] 替换成一个比较大的数 nums[j]3)将[i+1,末尾]的数都翻转一次感性的认识:next permutation 是要求 比当前这个数 稍微大一点点点的 那个数 ,那我们肯定是让 后面的位 增大, 比如 123...原创 2018-09-10 14:50:10 · 203 阅读 · 0 评论