Given two 1d vectors, implement an iterator to return their elements alternately. For example, given tw…
分类:LeetCode
[LeetCode] Permutation in String 字符串中的全排列
Given two strings s1 and s2, write a function to return true if s2 contains th…
[LeetCode] Exclusive Time of Functions 函数的独家时间
Given the running logs of n functions that are executed in a nonpreemptive single threaded CP…
LeetCode | Word Search
题目: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters…
Kth Largest in N Arrays
Easy Find K-th largest element in N arrays. Notice You can swap elements in the array Have you met this questi…
LeetCode刷题之路 Dota2 参议院
Dota2 参议院【中等】 Dota2 的世界里有两个阵营:Radiant(天辉)和 Dire(夜魇) Dota2 参议院由来自两派的参议员组成。现在参议院希望对一个 Dota2 游戏里的改变作出决定。他们以一个基于轮为…
[LeetCode] Invert Binary Tree 翻转二叉树
Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was i…
[LeetCode] Unique Substrings in Wraparound String 封装字符串中的独特子字符串
Consider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwx…
[LeetCode] Construct String from Binary Tree 根据二叉树创建字符串
You need to construct a string consists of parenthesis and integers from a binary tree with the preorde…
LeetCode | Palindrome Partitioning II
题目: Given a string s, partition s such that every substring of the partition is a palindrome. R…
LeetCode | Remove Element
题目: Given an array and a value, remove all instances of that value in place and return the new length. The ord…
209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarr…