136. Single Number Total Accepted: 122616 Total Submissions: 248345 Difficulty: Medium Given an array of integers, every element appears twice except ...
分类:
编程语言 时间:
2016-04-07 00:56:05
阅读次数:
186
Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. Example Given n = 3, You should return the following ...
分类:
其他好文 时间:
2016-04-06 13:31:14
阅读次数:
172
Given an integer array, find a subarray with sum closest to zero. Return the indexes of the first number and last number. Example Given [-3, 1, 1, -3, ...
分类:
其他好文 时间:
2016-04-06 13:13:21
阅读次数:
180
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example Given the following matrix: [ [ 1, 2, ...
分类:
其他好文 时间:
2016-04-06 11:25:15
阅读次数:
177
原文链接:https://medium.com/@laanayabdrzak/android-development-some-of-the-best-practices-27722c685b6a#.x3b8wsvz9 向原创致敬 在开发了几个项目之后我决定写篇文章分享一下一路走来的经验教训。 在使 ...
分类:
移动开发 时间:
2016-04-06 11:09:46
阅读次数:
174
题目: 解题思路:1、简单思路:暴力破解法,时间复杂度O(n^3),肯定通不过。 2、动态规划法:(一般含“最XX”等优化词义的题意味着都可以动态规划求解),时间复杂度O(n^2),空间复杂度O(n^2)。 形如"abba", "abbba"这样的字符串,如果用dp[i][j]表示从下标i到j之间的 ...
分类:
其他好文 时间:
2016-04-06 11:03:39
阅读次数:
202
Sort a linked list in O(n log n) time using constant space complexity. Example Given 1-3->2->null, sort it to 1->2->3->null. /** * Definition for List ...
分类:
其他好文 时间:
2016-04-06 08:12:15
阅读次数:
114
Given an array of n objects with k different colors (numbered from 1 to k), sort them so that objects of the same color are adjacent, with the colors ...
分类:
其他好文 时间:
2016-04-06 08:10:50
阅读次数:
189
Given a string which contains only letters. Sort it by lower case first and upper case second. Notice It's NOT necessary to keep the original order of ...
分类:
其他好文 时间:
2016-04-06 08:10:40
阅读次数:
143
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2016-04-06 07:05:41
阅读次数:
154