随笔分类 - LeetCode
摘要:/** * * @author gentleKay * Given a binary tree, determine if it is height-balanced. * For this problem, a height-balanced binary tree is defined as a
阅读全文
摘要:/** * * @author gentleKay * A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). * The robot can only move
阅读全文
摘要:/** * * @author gentleKay * Find the contiguous subarray within an array (containing at least one number) which has the largest sum. * For example, gi
阅读全文
摘要:/** * * @author gentleKay * Given a binary tree * Populate each next pointer to point to its next right node. If there is no next right node, the next
阅读全文
摘要:/** * * @author gentleKay * Given a roman numeral, convert it to an integer. * Input is guaranteed to be within the range from 1 to 3999. * * 给定一个罗马数字
阅读全文
摘要:/** * * @author gentleKay * Given two binary trees, write a function to check if they are equal or not. * Two binary trees are considered equal if the
阅读全文
摘要:/** * @author gentleKay * Determine whether an integer is a palindrome. Do this without extra space. * click to show spoilers. * Some hints: * Could n
阅读全文
摘要:/** * * @author gentleKay * Say you have an array for which the i th element is the price of a given stock on day i. * If you were only permitted to c
阅读全文
摘要:/** * * @author gentleKay * Given a linked list, determine if it has a cycle in it. * Follow up: * Can you solve it without using extra space? * * 给定一
阅读全文
摘要:/** * * @author gentleKay * Given an integer, convert it to a roman numeral. * Input is guaranteed to be within the range from 1 to 3999. * * 给定一个整数,将
阅读全文
摘要:/** * @author gentleKay * Given n non-negative integers a1 , a2 , ..., an , where each represents a point at coordinate (i, ai ). * n vertical lines a
阅读全文
摘要:/** * * @author gentleKay * Reverse digits of an integer. * Example1: x = 123, return 321 * Example2: x = -123, return -321 * click to show spoilers.
阅读全文
摘要:/** * @author gentleKay * Say you have an array for which the i th element is the price of a given stock on day i. * Design an algorithm to find the m
阅读全文
摘要:/** * @author gentleKay * 题目描述 * Given an array of integers, every element appears twice except for one. Find that single one. * Note: * Your algorith
阅读全文
摘要:/** * @author gentleKay * 题目描述 * Given a binary tree, find its maximum depth. * The maximum depth is the number of nodes along the longest path from t
阅读全文
摘要:题目描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another
阅读全文
摘要:题目描述 Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neare
阅读全文

浙公网安备 33010602011771号