2020年5月9日

摘要: Description Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represent 阅读全文
posted @ 2020-05-09 15:54 Jain_Shaw 阅读(121) 评论(0) 推荐(0) 编辑

2020年5月6日

摘要: Description Given an array nums of integers and an int k, partition the array (i.e move the elements in "nums") such that: All elements < k are moved 阅读全文
posted @ 2020-05-06 23:12 Jain_Shaw 阅读(112) 评论(0) 推荐(0) 编辑

2020年4月28日

摘要: Description Count the number of k's between 0 and n. k can be 0 - 9. Example : 实在是想不通这道题为啥会是mid难度的,不就一个遍历的事吗。。。在0~n个数字中,看看数字k出现的频次是多少。但是这个n,我们并不知道有多大, 阅读全文
posted @ 2020-04-28 09:15 Jain_Shaw 阅读(107) 评论(0) 推荐(0) 编辑

2020年4月26日

摘要: Problem Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return s 阅读全文
posted @ 2020-04-26 11:11 Jain_Shaw 阅读(372) 评论(0) 推荐(0) 编辑

2020年4月23日

摘要: Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than 阅读全文
posted @ 2020-04-23 11:07 Jain_Shaw 阅读(104) 评论(0) 推荐(0) 编辑

2020年4月20日

摘要: 给定一个数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。 返回滑动窗口中的最大值。 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/sliding- 阅读全文
posted @ 2020-04-20 20:15 Jain_Shaw 阅读(181) 评论(0) 推荐(0) 编辑

2020年4月15日

摘要: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he c 阅读全文
posted @ 2020-04-15 19:22 Jain_Shaw 阅读(142) 评论(0) 推荐(0) 编辑

2020年4月7日

摘要: 问题描述: 农夫想去找回他丢失的牛。设农夫当前的位置为N,牛的位置为K。农夫和牛都在数轴上。农夫有两种移动方式: 1.从X移动到X+1或X-1,花费的时间为1 min; 2.从X移动到X*2,花费的时间为1 min; 假设牛不会移动,求农夫最少需要多长时间才能抓到牛。 输入要求: 一行,分别为N和K 阅读全文
posted @ 2020-04-07 20:02 Jain_Shaw 阅读(151) 评论(0) 推荐(0) 编辑

2020年4月5日

摘要: 分班规则: 1)如果分数>=T2, 那么该学生会被分配到A班; 2)如果分数>=T1&&<T2,那么该学生会被分配到B班; 3)如果分数<T1,则该学生会被分配到C班。 4)每班的最小人数不能低于Kmin(>=Kmin),最大人数不能大于Kmax(<=Kmax) 现在,在T1,T2没有给定的情况下, 阅读全文
posted @ 2020-04-05 12:31 Jain_Shaw 阅读(119) 评论(0) 推荐(0) 编辑

2020年3月21日

摘要: 二叉树的遍历,无非就是按层遍历,先序遍历,中序遍历和后序遍历这几种。其中后三种的先,中,后等等是相对于根节点而言的。给出一棵二叉树,我们可以按照相对应的规则去输出它的遍历序列,同样的,如果满足一定的条件,那么也可以通过给出的序列来还原相对应的二叉树。 以满二叉树为例,如下图:(略丑,将就看看) 这棵 阅读全文
posted @ 2020-03-21 17:03 Jain_Shaw 阅读(280) 评论(0) 推荐(0) 编辑

导航