上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 33 下一页
摘要: Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iterativ 阅读全文
posted @ 2019-12-29 11:59 xuan_abc 阅读(119) 评论(0) 推荐(0)
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 阅读全文
posted @ 2019-12-27 12:16 xuan_abc 阅读(131) 评论(0) 推荐(0)
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2019-12-19 12:13 xuan_abc 阅读(240) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use 阅读全文
posted @ 2019-12-19 12:01 xuan_abc 阅读(162) 评论(0) 推荐(0)
摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2019-12-19 11:20 xuan_abc 阅读(207) 评论(0) 推荐(0)
摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di 阅读全文
posted @ 2019-12-18 21:59 xuan_abc 阅读(133) 评论(0) 推荐(0)
摘要: Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 /** * Definition for a binary tree node. * public cl 阅读全文
posted @ 2019-12-18 10:58 xuan_abc 阅读(89) 评论(0) 推荐(0)
摘要: Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: I 阅读全文
posted @ 2019-12-17 12:42 xuan_abc 阅读(138) 评论(0) 推荐(0)
摘要: There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai 阅读全文
posted @ 2019-12-17 12:14 xuan_abc 阅读(174) 评论(0) 推荐(0)
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2019-12-17 11:55 xuan_abc 阅读(159) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 33 下一页