本文首发于我的个人博客:尾尾部落 题目描述 求1+2+3+…+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 解题思路 累加不能用循环…
分类:LeetCode
[剑指offer] 数组中重复的数字
本文首发于我的个人博客:尾尾部落 题目描述 在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的,但不知道有几个数字是重复的。也不知道每个数字重复几次。请找出数组中任意一个重复的数字。 例如,…
[LeetCode]Max Area of Island 岛屿的最大面积
链接:https://leetcode.com/problems/max-area-of-island/description/ 难度:Easy 题目:695. Max Area of Island Given a no…
LeetCode 211 Add and Search Word - Data structure design
题目描述 Design a data structure that supports the following two operations: void addWord(word) bool search(word) …
ZigZag Conversion
转载请注明出处: http://egoistk21.xyz/2016/09/29/ZigZag Conversion/ 锯齿形转换 字符串“PAYPALISHIRING”以给定数字的行数被写入锯齿形图案: P A H N…
111. Minimum Depth of Binary Tree
111. Minimum Depth of Binary Tree 题目: https://leetcode.com/problems/minimum-depth-of-binary-tree/ 难度: Easy 注意l…
Longest Increasing Continuous Subsequence
Easy Give an integer array,find the longest increasing continuous subsequence in this array. An increasing con…
Leetcode 90. Subsets II
Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The sol…
LeetCode 278 First Bad Version
题目描述 You are a product manager and currently leading a team to develop a new product. Unfortunately, the lates…
[Leetcode] Find the Duplicate Number 找到重复数字
Find the Duplicate Number Given an array nums containing n + 1 integers where each integer is between 1 and n …
LeetCode 13. Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Su…
LeetCode | Subsets II(带有重复数据的数组的子集)
Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Eleme…