09 2019 档案

摘要:题目如下: 力扣团队买了一个可编程机器人,机器人初始位置在原点(0, 0)。小伙伴事先给机器人输入一串指令command,机器人就会无限循环这条指令的步骤进行移动。指令有两种: U: 向y轴正方向移动一格R: 向x轴正方向移动一格。不幸的是,在 xy 平面上还有一些障碍物,他们的坐标用obstacl 阅读全文
posted @ 2019-09-29 09:47 seyjs 阅读(366) 评论(0) 推荐(0)
摘要:题目如下: 小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次? 输入的guess数组为 小A 每次的猜测,answer数组为 小B 每次的选择。guess和answer的长度都等 阅读全文
posted @ 2019-09-29 09:42 seyjs 阅读(346) 评论(0) 推荐(0)
摘要:题目如下: 楼下水果店正在促销,你打算买些苹果,arr[i] 表示第 i 个苹果的单位重量。 你有一个购物袋,最多可以装 5000 单位重量的东西,算一算,最多可以往购物袋里装入多少苹果。 示例 1: 示例 2: 解题思路:排好序后,从小的装起。 代码如下: 阅读全文
posted @ 2019-09-29 09:27 seyjs 阅读(470) 评论(0) 推荐(0)
摘要:题目如下: 给你一个矩阵 mat,其中每一行的元素都已经按 递增 顺序排好了。请你帮忙找出在所有这些行中 最小的公共元素。 如果矩阵中没有这样的公共元素,就请返回 -1。 示例: 提示: 1 <= mat.length, mat[i].length <= 500 1 <= mat[i][j] <= 阅读全文
posted @ 2019-09-29 09:26 seyjs 阅读(957) 评论(0) 推荐(0)
摘要:题目如下: Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c. Example 1: Example 2: Examp 阅读全文
posted @ 2019-09-25 10:36 seyjs 阅读(558) 评论(0) 推荐(0)
摘要:题目如下: You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the str 阅读全文
posted @ 2019-09-25 10:25 seyjs 阅读(1017) 评论(0) 推荐(0)
摘要:题目如下: Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. Return a list of p 阅读全文
posted @ 2019-09-25 10:16 seyjs 阅读(448) 评论(0) 推荐(0)
摘要:题目如下: Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially contains only the firs 阅读全文
posted @ 2019-09-25 10:14 seyjs 阅读(208) 评论(0) 推荐(0)
摘要:最近在学习在windows平台用flask框架提供Restful API服务,需要使得flask的windows应用能够开机自动运行,并且后台运行,所以通过service来实现。 首先尝试的是在自己派生的serivice类的中直接调用 create_app(debug=True).run(host= 阅读全文
posted @ 2019-09-20 11:08 seyjs 阅读(3885) 评论(0) 推荐(0)
摘要:题目如下: We have a sequence of books: the i-th book has thickness books[i][0] and height books[i][1]. We want to place these books in order onto bookcase 阅读全文
posted @ 2019-09-20 05:53 seyjs 阅读(388) 评论(0) 推荐(0)
摘要:题目如下: Given an integer array arr and an integer k, modify the array by repeating it k times. For example, if arr = [1, 2] and k = 3 then the modified 阅读全文
posted @ 2019-09-17 10:32 seyjs 阅读(485) 评论(0) 推荐(0)
摘要:题目如下: Given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting fr 阅读全文
posted @ 2019-09-17 10:21 seyjs 阅读(645) 评论(0) 推荐(0)
摘要:题目如下: Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each charac 阅读全文
posted @ 2019-09-17 10:17 seyjs 阅读(412) 评论(0) 推荐(0)
摘要:题目如下: In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are some special offers, and a special offer con 阅读全文
posted @ 2019-09-16 10:41 seyjs 阅读(207) 评论(0) 推荐(0)
摘要:题目如下: In a project, you have a list of required skills req_skills, and a list of people. The i-th person people[i] contains a list of skills that pers 阅读全文
posted @ 2019-09-16 10:33 seyjs 阅读(689) 评论(0) 推荐(0)
摘要:题目如下: You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity. I 阅读全文
posted @ 2019-09-14 21:43 seyjs 阅读(382) 评论(0) 推荐(0)
摘要:题目如下: SQL Schema Table: Department + + + | Column Name | Type | + + + | id | int | | revenue | int | | month | varchar | + + + (id, month) is the prim 阅读全文
posted @ 2019-09-12 13:33 seyjs 阅读(1110) 评论(0) 推荐(0)
摘要:题目如下: Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other wo 阅读全文
posted @ 2019-09-12 13:29 seyjs 阅读(482) 评论(0) 推荐(0)
摘要:题目如下: Given a date, return the corresponding day of the week for that date. The input is given as three integers representing the day, month and year  阅读全文
posted @ 2019-09-12 13:12 seyjs 阅读(479) 评论(0) 推荐(0)
摘要:题目如下: A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is 阅读全文
posted @ 2019-09-12 13:10 seyjs 阅读(453) 评论(0) 推荐(0)
摘要:题目如下: With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: word contains the first letter of puzzle. 阅读全文
posted @ 2019-09-06 16:10 seyjs 阅读(496) 评论(0) 推荐(0)
摘要:题目如下: Given a string s, we make queries on substrings of s. For each query queries[i] = [left, right, k], we may rearrange the substring s[left], ..., 阅读全文
posted @ 2019-09-06 15:59 seyjs 阅读(516) 评论(2) 推荐(0)
摘要:题目如下: Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.) (Recall that an integer is prime if and only 阅读全文
posted @ 2019-09-06 15:45 seyjs 阅读(555) 评论(0) 推荐(0)