摘要: 题目如下: Given a 2D grid of size n * m and an integer k. You need to shift the grid k times. In one shift operation: Element at grid[i][j] becomes at gri 阅读全文
posted @ 2019-11-20 10:55 seyjs 阅读(463) 评论(0) 推荐(0)
摘要: 题目如下: Given an array nums of integers, we need to find the maximum possible sum of elements of the array such that it is divisible by three. Example 1 阅读全文
posted @ 2019-11-20 10:50 seyjs 阅读(591) 评论(0) 推荐(0)
摘要: 题目如下: Given a binary tree with the following rules: Now the binary tree is contaminated, which means all treeNode.val have been changed to -1. You nee 阅读全文
posted @ 2019-11-20 10:47 seyjs 阅读(395) 评论(0) 推荐(0)
摘要: 题目如下: Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] and delete it to earn nums[i]  阅读全文
posted @ 2019-11-20 10:44 seyjs 阅读(271) 评论(0) 推荐(0)
摘要: 题目如下: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a dee 阅读全文
posted @ 2019-11-20 10:34 seyjs 阅读(107) 评论(0) 推荐(0)
摘要: 题目如下: 解题思路:动态规划。记dp[i] = v表示由i个人组成的圈子一共有v种握手的方法。对于一个由n个人组成的圈子,编号为0的人一共可以和编号为 (1,3,5....,n-1)的握手,这也很好理解,假设编号为0的人和编号为2的人握手,那么编号为1的人就被包在两人的连线的一侧,而同侧没有其他人 阅读全文
posted @ 2019-11-20 10:29 seyjs 阅读(448) 评论(0) 推荐(0)
摘要: 题目如下: You are given some lists of regions where the first region of each list includes all other regions in that list. Naturally, if a region X contai 阅读全文
posted @ 2019-11-20 10:15 seyjs 阅读(523) 评论(0) 推荐(0)
摘要: 题目如下: Given a list of pairs of equivalent words synonyms and a sentence text, Return all possible synonymous sentences sorted lexicographically. Examp 阅读全文
posted @ 2019-11-20 07:11 seyjs 阅读(971) 评论(0) 推荐(0)
摘要: 题目如下: Design a Leaderboard class, which has 3 functions: Initially, the leaderboard is empty. Example 1: Constraints: 1 <= playerId, K <= 10000 It's g 阅读全文
posted @ 2019-11-20 07:04 seyjs 阅读(727) 评论(0) 推荐(0)
摘要: 题目如下: Given an initial array arr, every day you produce a new array using the array of the previous day. On the i-th day, you do the following operati 阅读全文
posted @ 2019-11-20 07:02 seyjs 阅读(671) 评论(0) 推荐(0)