7.整数反转 给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 示例 1: 输入: 123 输出: 321 示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: 21…
分类:LeetCode
25. Reverse Nodes in k-Group
25. Reverse Nodes in k-Group 题目 Given a linked list, reverse the nodes of a linked list k at a time and return…
[LeetCode] Trips and Users 旅行和用户
The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_I…
[LeetCode] Rabbits in Forest 森林里的兔子
In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how man…
LeetCode 035 Search Insert Position
题目描述 Given a sorted array and a target value, return the index if the target is found. If not, return the inde…
[Leetcode] Multiply String and Big Interger 大数乘法加法减法
Multiply Strings Given two numbers represented as strings, return multiplication of the numbers as a string. N…
220. Contains Duplicate III解题报告
Description: Given an array of integers, find out whether there are two distinct indices i and j in the array …
[LeetCode] Arithmetic Slices 算数切片
A sequence of number is called arithmetic if it consists of at least three elements and if the differen…
【leetcode】28. Implement strStr() 字符串匹配KMP BM
1. 题目 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is …
不新建数组完成数据去重问题
题外话:除了业务逻辑,我们应该还需要关注代码的艺术,编程之美。慢慢的把涉及到算法 数据结构 典型的操作基本类型的例子记录下来。 leetcoode 题目 Given a sorted array, remove the …
461. Hamming Distance
题目地址:https://leetcode.com/problems/hamming-distance/description/ 大意:求两个int型整数的汉明距离(Hamming Distance) 比较简单,两个二进…
2018-05-18 递归求树的深度
题意:给你一个树,返回树的最大深度。 解题思路:使用深度优先搜索,从树的根开始,递归搜索,递归结束条件是,如果该节点为空,则返回0;否则返回左子节点和右子节点的最大值加1。 时间复杂度:待 空间复杂度:待 class S…