Rotate List Given a list, rotate the list to the right by k places, where k is non-negative. For example: Give…
分类:LeetCode题目解答
【Leetcode】12. Integer to Roman 阿拉伯数字转罗马数字
1. 题目 Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 39…
45. Jump Game II
45. Jump Game II 题目 Given an array of non-negative integers, you are initially positioned at the first index o…
[LeetCode] Populating Next Right Pointers in Each Node 每个节点的右向指针
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; …
LeetCode | Minimum 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] Valid Anagram 验证变形词
Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For example, s…
[LeetCode] Minimum Window Substring 最小窗口子串
Given a string S and a string T, find the minimum window in S which will contain all the characters in …
[LeetCode] Number of Islands 岛屿的数量
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island i…
[LeetCode] Super Pow 超级次方
Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positiv…
[LeetCode] Wiggle Subsequence 摆动子序列
A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictl…
[LeetCode] Linked List Components 链表组件
We are given head, the head node of a linked list containing unique integer values. We a…
LeetCode | Best Time to Buy and Sell Stock II
题目: Say you have an array for which the ith element is the price of a given stock on day i. Des…