
值得再刷一遍
ForABiggerWorld
这个作者很懒,什么都没留下…
展开
-
1434. Number of Ways to Wear Different Hats to Each Other
There arenpeopleand 40 types of hats labeled from 1 to 40.Given a list of list of integershats, wherehats[i]is a list of all hats preferredby thei-thperson.Return the number of ways that ...原创 2020-05-05 11:22:35 · 401 阅读 · 0 评论 -
1392. Longest Happy Prefix
A string is called ahappy prefixif is anon-emptyprefix which is also a suffix (excluding itself).Given a strings. Return thelongest happy prefixofs.Return an empty string if no such prefi...原创 2020-03-25 22:45:35 · 323 阅读 · 0 评论 -
1373. Maximum Sum BST in Binary Tree
Given abinary treeroot, the task is to return the maximum sum of all keys ofanysub-tree which is also a Binary Search Tree (BST).Assume a BST is defined as follows:The left subtree of a node c...原创 2020-03-16 22:05:42 · 374 阅读 · 0 评论 -
1235. Maximum Profit in Job Scheduling
We havenjobs, where every jobis scheduled to be done fromstartTime[i]toendTime[i], obtaining a profitofprofit[i].You're given thestartTime,endTimeandprofitarrays,you need to output th...原创 2019-10-20 14:33:05 · 297 阅读 · 0 评论 -
1223. Dice Roll Simulation
A die simulator generates a random number from 1 to 6 for each roll.You introduced a constraint to the generator such that it cannot roll the numberimore thanrollMax[i](1-indexed)consecutivetim...原创 2019-10-19 19:47:53 · 410 阅读 · 0 评论 -
44. Wildcard Matching
Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t原创 2016-11-17 16:57:04 · 356 阅读 · 0 评论 -
862. Shortest Subarray with Sum at Least K
Return thelengthof the shortest, non-empty, contiguoussubarray ofAwith sum at leastK.If there is no non-empty subarray with sum at leastK, return-1.Example 1:Input: A = [1], K = 1Ou...原创 2018-08-18 09:40:03 · 241 阅读 · 0 评论