题目: A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] …
分类:LeetCode
70.爬楼梯
70.爬楼梯 假设你正在爬楼梯。需要 阶你才能到达楼顶。 每次你可以爬 或 个台阶。你有多少种不同的方法可以爬到楼顶呢? 注意:给定 是一个正整数。 示例 1: 输入: 输出: 解释: 有两种方法可以爬到楼顶。 阶 + …
Leetcode 65. Valid Number
Validate if a given string is numeric. Some examples: “0” => true ” 0.1 ” => tru…
Leetcode 128. Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example…
Day 20. Repeated String Match(686)
问题描述 Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substri…
29. Divide Two Integers
欢迎fork and star:Nowcoder-Repository-github 29. Divide Two Integers 题目 Divide two integers without using multip…
101. Symmetric Tree
欢迎fork and star:Nowcoder-Repository-github 101. Symmetric Tree 题目 Given a binary tree, check whether it is a m…
[LeetCode] Remove Linked List Elements 移除链表元素
Remove all elements from a linked list of integers that have value val. Example Given: 1 –> 2 …
LeetCode 220 Contains Duplicate III
题目描述 Given an array of integers, find out whether there are two distinct indices i and j in the array such tha…
LeetCode | Reverse Nodes in k-Group(k个结点一组翻转链表)
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If…
2018-06-03 846. Hand of Straights
题意:给你一个数组vector,给你一个数W,问能否将vector数组均分,对每份来说数量都是W,而且每份都是连续的数字。 解题思路:先对vector做个排序,然后使用一个map(其实可以使用set的)存储下标数,遍历m…
13. Roman to Integer
欢迎fork and star:Nowcoder-Repository-github 13. Roman to Integer 题目 Given a roman numeral, convert it to an int…