摘要: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2017-09-11 23:14 immjc 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 问题:将一个n元一维向量向左旋转i个位置。例如,当n=8且i=3时,向量abcdefgh旋转为defghabc。简单的代码使用一个n元中间量在n步内完成该工作,你能否仅使用数十个额外字节的存储空间,在正比于n的时间内完成向量的旋转? Brute Algorithm:将需要移动的字符串x前i个元素复制 阅读全文
posted @ 2017-09-11 17:20 immjc 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-09-11 10:45 immjc 阅读(144) 评论(0) 推荐(0) 编辑