欢迎来到PJCK的博客

上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Example 2: 阅读全文
posted @ 2019-04-25 19:37 PJCK 阅读(164) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2019-04-23 21:14 PJCK 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y 阅读全文
posted @ 2019-04-23 20:07 PJCK 阅读(369) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文
posted @ 2019-04-23 19:44 PJCK 阅读(170) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return 阅读全文
posted @ 2019-04-23 19:01 PJCK 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Description Insert a node in a sorted linked list. Description Description Insert a node in a sorted linked list. Insert a node in a sorted linked lis 阅读全文
posted @ 2019-04-23 18:21 PJCK 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2019-04-23 18:06 PJCK 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 题意翻译 题目描述 农夫约翰正驾驶一条小艇在牛勒比海上航行. 海上有N(1≤N≤100)个岛屿,用1到N编号.约翰从1号小岛出发,最后到达N号小岛. 一张藏宝图上说,如果他的路程上经过的小岛依次出现了Ai,A2,…,AM(2≤M≤10000)这样的序列(不一定相邻),那他最终就能找到古老的宝藏. 但 阅读全文
posted @ 2019-04-20 19:16 PJCK 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, yo 阅读全文
posted @ 2019-04-19 20:47 PJCK 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N 阅读全文
posted @ 2019-04-19 20:38 PJCK 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2019-04-19 20:28 PJCK 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iterativel 阅读全文
posted @ 2019-04-17 18:43 PJCK 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2019-04-17 17:35 PJCK 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2019-04-17 08:07 PJCK 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2019-04-17 08:02 PJCK 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页