题目地址:https://leetcode-cn.com/probl…题目描述:给定一个二叉树,在树的最后一行找到最左边的值。 示例 1: 输入: 2 / \ 1 3 输出:1 示例 2: 输入: 1 / \…
分类:LeetCode题目解答
[LeetCode] Excel Sheet Column Title 求Excel表列名称,Excel Sheet Column Number,Excel Sheet Column Number
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For exampl…
LeetCode | Maximum Depth of Binary Tree
题目: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest p…
LeetCode | Jump Game II
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Eac…
989. Add to Array-Form of Integer
For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For exampl…
【Leetcode】14. Longest Common Prefix 两个字符串的最长公共前缀长度
1. 题目 Write a function to find the longest common prefix string amongst an array of strings. 2. 思路 遍历按序逐个比较,直接…
[LeetCode] Multiply Strings 字符串相乘
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The n…
[LeetCode] Delete Node in a Linked List 删除链表的节点
Write a function to delete a node (except the tail) in a singly linked list, given only access to that …
[LeetCode] Remove K Digits 去掉K位数字
Given a non-negative integer num represented as a string, remove k digits from the …
[LeetCode] Sentence Similarity 句子相似度
Given two sentences words1, words2 (each represented as an array of strings), and a list of s…
LeetCode 754. Reach a Number到达终点数字
题目 在一根无限长的数轴上,你站在0的位置。终点在target的位置。 每次你可以选择向左或向右移动。第 n 次移动(从 1 开始),可以走 n 步。 返回到达终点需要的最小移动次数。 示例 1: 输入: target …
[LeetCode] Read N Characters Given Read4 用Read4来读取N个字符
The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual n…