摘要: 题目: 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 i 阅读全文
posted @ 2019-05-11 23:18 silentteller 阅读(453) 评论(0) 推荐(0)
摘要: 题目: Given a non-empty string s and a dictionary wordDict containing a list of non-emptywords, determine if s can be segmented into a space-separated s 阅读全文
posted @ 2019-05-11 23:08 silentteller 阅读(434) 评论(0) 推荐(1)
摘要: 题目: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: 阅读全文
posted @ 2019-05-11 00:15 silentteller 阅读(279) 评论(0) 推荐(0)
摘要: 题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given th 阅读全文
posted @ 2019-05-10 00:45 silentteller 阅读(568) 评论(0) 推荐(0)
摘要: 题目: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Ex 阅读全文
posted @ 2019-05-08 00:03 silentteller 阅读(353) 评论(3) 推荐(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 su 阅读全文
posted @ 2019-05-07 00:40 silentteller 阅读(352) 评论(0) 推荐(0)
摘要: 题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can yo 阅读全文
posted @ 2019-04-23 23:55 silentteller 阅读(478) 评论(0) 推荐(0)
摘要: 题目: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the 阅读全文
posted @ 2019-04-22 23:43 silentteller 阅读(292) 评论(0) 推荐(0)
摘要: 题目: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be 阅读全文
posted @ 2019-04-22 00:05 silentteller 阅读(216) 评论(0) 推荐(0)
摘要: 题目: Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: 分析: 给定一个 阅读全文
posted @ 2019-04-21 23:52 silentteller 阅读(264) 评论(0) 推荐(0)