0%

  • 141.链表是否有环 + 142.链表入环节点
    1. 快乐数
    1. 寻找重复数
    1. 删除链表的倒数第N个节点
阅读全文 »

问题描述

Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties:

Integers in each row are sorted in ascending from left to right.
Integers in each column are sorted in ascending from top to bottom.

阅读全文 »

转载

关于变量提升的原因是和预编译有关的。

预编译什么时候发生

全局预编译:页面加载完成时执行

函数预编译:函数执行的前一刻

阅读全文 »

问题描述

you are climbing a staircase. It takes n steps to reach the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

阅读全文 »

问题描述

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

阅读全文 »

问题描述

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.

阅读全文 »