摘要: Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2018-07-08 21:11 小T在学习 阅读(670) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
posted @ 2018-07-08 20:13 小T在学习 阅读(372) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文
posted @ 2018-07-08 10:50 小T在学习 阅读(455) 评论(0) 推荐(1) 编辑
摘要: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 反转链表,链表算法 阅读全文
posted @ 2018-07-08 10:49 小T在学习 阅读(3854) 评论(0) 推荐(1) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
posted @ 2018-07-08 10:47 小T在学习 阅读(473) 评论(0) 推荐(0) 编辑