摘要:
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 nu... 阅读全文
摘要:
>Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except... 阅读全文
摘要:
>Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.>Supposed the linked list is 1 -> 2 -> 3 ... 阅读全文
摘要:
#Future当向一个ExecutorService提交任务后可以获得一个Future对象,在该对象上可以调用`get`,`cancel`等命令来获取任务运行值或者是取消任务。下面是一个简单的计数任务:```public class NormalFuture { public static v... 阅读全文
摘要:
>Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.>According to the definition of LCA on Wikipedia: “The lowe... 阅读全文
摘要:
>Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.>For example:>Given n = 13,>Retu... 阅读全文
摘要:
>Given a singly linked list, determine if it is a palindrome.>Follow up:>Could you do it in O(n) time and O(1) space?```/** * Definition for singly-li... 阅读全文
摘要:
>Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.>According to the definition of LCA on Wikipedi... 阅读全文