2019年3月7日

[Leetcode 163] Missing Ranges

摘要: Missing Ranges Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For exam 阅读全文

posted @ 2019-03-07 17:42 xiatianhappy 阅读(96) 评论(0) 推荐(0)

2019年3月6日

[Leetcode 361] Bomb Enemy

摘要: Bomb Enemy Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using 阅读全文

posted @ 2019-03-06 18:28 xiatianhappy 阅读(244) 评论(0) 推荐(0)

2018年3月23日

Remove Linked List Elements

摘要: 题目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 阅读全文

posted @ 2018-03-23 23:07 xiatianhappy 阅读(92) 评论(0) 推荐(0)

2018年3月18日

构造数组的MaxTree [Maximum Binary Tree]

摘要: 题目: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given arr 阅读全文

posted @ 2018-03-18 11:02 xiatianhappy 阅读(177) 评论(0) 推荐(0)

2018年3月15日

生成窗口最大值数组 Sliding Window Maximum

摘要: 题目: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k 阅读全文

posted @ 2018-03-15 23:32 xiatianhappy 阅读(91) 评论(0) 推荐(0)

2018年3月3日

仅用递归函数和栈操作来逆序一个栈

摘要: 题目: 如题,不能借助其他数据结构 递归函数一:获取栈底元素并弹出 递归函数二:逆序栈 阅读全文

posted @ 2018-03-03 15:31 xiatianhappy 阅读(131) 评论(0) 推荐(0)

由两个栈组成的队列

摘要: 题目: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in f 阅读全文

posted @ 2018-03-03 13:18 xiatianhappy 阅读(91) 评论(0) 推荐(0)

Min Stack

摘要: 从今天开始刷题,在此开始第一题,先立一个Flag,一周两题以上。 先从经典的题目开始刷起,一般题目都可以从LeetCode上面找到,也有很多题目是学习左程云的《程序员代码面试指南》。 题目: Design a stack that supports push, pop, top, and retri 阅读全文

posted @ 2018-03-03 12:56 xiatianhappy 阅读(102) 评论(0) 推荐(0)

导航