标签归档:leetcode

RSS feed of leetcode

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]

题目大意:

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

解题思路:

二叉树的层次遍历 ...

继续阅读

[LeetCode]Base 7

题目描述:

LeetCode 504. Base 7

Given an integer, return its base 7 string representation.

Example 1:

Input: 100
Output: "202"

Example 2:

Input: -7
Output: "-10"

Note: The input will be in range of [-1e7, 1e7].

题目大意:

给定一个整数,返回其7进制的字符串 ...

继续阅读