Reverse Words in a String Given an input string, reverse the string word by word. Example 1: Input: "the sky is blue" Output: "blue is sky the" Exampl ...
分类:
其他好文 时间:
2020-07-07 15:09:44
阅读次数:
43
Evaluate Reverse Polish Notation Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each opera ...
分类:
其他好文 时间:
2020-07-07 13:36:17
阅读次数:
47
package com.example.lettcode.offer; import java.util.HashMap; import java.util.Map; /** * @Class CopyRandomList * @Description 剑指 Offer 35. 复杂链表的复制 * ...
分类:
其他好文 时间:
2020-07-07 13:26:38
阅读次数:
57
给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。 返回 s 所有可能的分割方案。 示例: 输入: "aab"输出:[ ["aa","b"], ["a","a","b"]] 链接:https://leetcode-cn.com/problems/palindrome-partitio ...
分类:
其他好文 时间:
2020-07-07 13:26:07
阅读次数:
67
1.两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 给定 nums = [2, 7, 11, 15], target = 9 ...
分类:
其他好文 时间:
2020-07-07 13:12:43
阅读次数:
39
知识点:动态规划、单调栈 LeetCode第八十五题:https://leetcode-cn.com/problems/maximal-rectangle/submissions/ 有些题目是真的难,比如这题,答案都不一定抄的明白。 语言:GoLang // 结合LeetCode 84题,逐行计算。 ...
分类:
其他好文 时间:
2020-07-07 13:03:19
阅读次数:
61
题目: 给定一个二叉树,检查它是否是镜像对称的。 例如,二叉树 [1,2,2,3,4,4,3] 是对称的。 1 / \ 2 2 / \ / \3 4 4 3 但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的: 1 / \ 2 2 \ \ 3 3 来源:力扣(LeetCode ...
分类:
编程语言 时间:
2020-07-07 12:53:28
阅读次数:
53
方法1:递归 /** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ bool hasPath ...
分类:
其他好文 时间:
2020-07-07 10:22:49
阅读次数:
60
题目来源:leetcode136 只出现一次的数字 题目描述: 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 示例 1: 输入: [2,2,1] 输出: 1 示例 2: ...
分类:
其他好文 时间:
2020-07-07 10:10:04
阅读次数:
49
##一、二维数组入参 参考:https://blog.csdn.net/minzhimo4854/article/details/89303797 (1)方法一:简单干脆地传入二维数组名,对于实参,若为数组定义,需要强制转换;转换后利用一维数组的方式取数;若为动态内存申请,不需要强制转换;主要是在题 ...
分类:
其他好文 时间:
2020-07-07 09:58:21
阅读次数:
88