摘要: Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, givenn... 阅读全文
posted @ 2015-10-22 22:52 Justin.cn 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to delete all duplicate email entries in a table namedPerson, keeping only unique emails based on itssmallestId.+----+--------------... 阅读全文
posted @ 2015-10-21 23:10 Justin.cn 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking num... 阅读全文
posted @ 2015-10-21 20:24 Justin.cn 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Consecutive NumbersWrite a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 ... 阅读全文
posted @ 2015-10-21 20:23 Justin.cn 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 首先,记录下遇到的问题吧,在抓取的过程中为了避免IO操作,主要用Redis做插入缓存,当内存占用率很大时,会周期性的持续到Mysql里虽然是拆东墙补西墙,但把数据抓取完毕后持续化可以慢慢进行,毕竟数据已经保存到内存里了,但问题来了,由于Redis的内存管理机制并不会在数据删除后立即释放内存,使得将数... 阅读全文
posted @ 2015-09-27 08:28 Justin.cn 阅读(540) 评论(0) 推荐(0) 编辑
摘要: SpinlockFrom Wikipedia, the free encyclopediaThis article needs additional citations for verification. Please help improve this article by adding cita... 阅读全文
posted @ 2015-07-09 19:49 Justin.cn 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Summary RangesTotal Accepted: 2073 Total Submissions: 9344Given a sorted integer array without duplicates, return the summary of its ranges.For exampl... 阅读全文
posted @ 2015-06-27 02:06 Justin.cn 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Search a 2D MatrixTotal Accepted: 43629 Total Submissions: 138231Write an efficient algorithm that searches for a value in an m x n matrix. This matri... 阅读全文
posted @ 2015-06-19 18:04 Justin.cn 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Rotate ImageTotal Accepted: 37958 Total Submissions: 118891You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (cloc... 阅读全文
posted @ 2015-06-18 20:55 Justin.cn 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Length of Last WordTotal Accepted: 47690 Total Submissions: 168587Given a string s consists of upper/lower-case alphabets and empty space characters '... 阅读全文
posted @ 2015-06-06 16:05 Justin.cn 阅读(207) 评论(0) 推荐(0) 编辑