摘要: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文
posted @ 2017-08-04 15:04 mstark 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 最近在自学一些s的内容,用到了vscode来编写代码,一直没有使用过vs调试js的代码,看到左侧有推荐一个插件Debugger for Chrome使用来调试js代码的,对于vs这种开源,需要安装各种插件来支撑我们编写代码的编辑器,在灵活轻量的同时,插件的配置使用对于刚开始入手的童鞋确实有点难度。下 阅读全文
posted @ 2017-08-03 15:01 mstark 阅读(43816) 评论(3) 推荐(1) 编辑
摘要: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2017-08-02 23:56 mstark 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1>获取 1.1:字符串中包含的字符数,也就是字符串的长度。 int length():获取长度 1.2:根据位置获取位置上某个字符。 char charAt(int index) 1.3:根据字符获取该字符在字符串中的位置。 int indexOf(int ch):返回的是ch在字符串中第一次出现 阅读全文
posted @ 2017-07-31 22:57 mstark 阅读(1978) 评论(0) 推荐(0) 编辑
摘要: HashMap的应用可以提高查找的速度,键key,值value的使用拜托了传统数组的遍历查找方式,对于判断一个字符或者字符串是否已经存在的问题可以非常好的解决。而本题需要解决的问题就是判断新遍历到的字符是否已经存在于左left,右right,字符构成的子串之中。 解题思路:设置一个left作为子串的 阅读全文
posted @ 2017-07-31 21:56 mstark 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-07-28 21:27 mstark 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 思考的方向不对,即使用了多于别人几倍的时间,也不一定能够达到终点。 我的错误的想法(可以跳过):在leetcode上面做的第四道题,走路一个很大的弯路,收到之前做过的 Container With Most Water 的思路的影响,自己也想到了可以使用两个指针从左右遍历数组, 然而自己在这里走偏了 阅读全文
posted @ 2017-07-28 21:20 mstark 阅读(199) 评论(0) 推荐(0) 编辑
摘要: vscode这款编辑器让人用起来很舒服,但是刚刚入手的童鞋可能会对其插件的安装产生一些恐惧,虽然vscode提供了插件的搜索和安装,但是其中一些插件是需要一些软件或者包之类的东西做支撑的,并不是在vscode里面下载好了之后就可以使用了,下载好了插件但是没有实现支撑的话vscode频繁的报错真的能逼 阅读全文
posted @ 2017-07-27 11:52 mstark 阅读(15793) 评论(0) 推荐(1) 编辑
摘要: 题目: 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 e 阅读全文
posted @ 2017-07-25 21:38 mstark 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 做leetcode题目的第二天,我是按照分类来做的,做的第一类是Array类,碰见的第二道题目,也就是今天做的这个,题目难度为hard。题目不难理解,但是要求到了时间复杂度,就需要好好考虑使用一下算法了。刚开始没啥思路,就用暴力的方法,用双层循环遍历的一下两个已经排好序的数组 ,在中间位置停止找道中 阅读全文
posted @ 2017-07-25 19:41 mstark 阅读(181) 评论(0) 推荐(0) 编辑