# 归档 2017年4月

## LeetCode Weekly Contest 29解题报告 作者是 在线疯狂 发布于 2017年4月23日 在 LeetCode.

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

LeetCode 563. Binary Tree Tilt

LeetCode 561. Array Partition I

LeetCode 562. Longest Line of Consecutive One in Matrix

LeetCode 564. Find the Closest Palindrome

## 题目描述：

LeetCode 564. Find the Closest Palindrome

Given an integer n, find the closest integer (not including itself), which is a palindrome.

The 'closest' is defined as absolute difference minimized between two integers.

Example 1:

```Input: "123"
Output: "121"
```

Note ...

## 题目描述：

LeetCode 562. Longest Line of Consecutive One in Matrix

Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal.

Example:

```Input:
[[0,1,1,0 ...```

## 题目描述

LeetCode 561. Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum ...

## 题目描述：

LeetCode 563. Binary Tree Tilt

Given a binary tree, return the tilt of the whole tree.

The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and the ...