归档 2017

[LeetCode]Longest Palindromic Subsequence

题目描述:

LeetCode 516. Longest Palindromic Subsequence

Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.

Example 1:
Input:

"bbbab"

Output:

4

One possible longest palindromic subsequence ...

继续阅读

LeetCode Weekly Contest 19解题报告

LeetCode Weekly Contest 19是LeetCode举办的第二十四场正式周赛,共4道题目,比赛时长1.5小时。

比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-19/

题解列表:

LeetCode 504. Base 7

LeetCode 513. Find Left Most Element

LeetCode 515. Find Largest Element in Each Row

LeetCode 493. Reverse Pairs

[LeetCode]Find Largest Element in Each Row

题目描述:

LeetCode 515. Find Largest Element in Each Row

You need to find the largest value in each row of a binary tree.

Example:

Input: 

          1
         / \
        3   2
       / \   \  
      5   3   9 

Output: [1, 3, 9]

题目大意:

给定二叉树,返回其每一行的最大元素。

解题思路:

二叉树的层次遍历 ...

继续阅读

每月存档

去年

明年