摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Description Count the number of k's between 0 and n. k can be 0 - 9. Example : 实在是想不通这道题为啥会是mid难度的,不就一个遍历的事吗。。。在0~n个数字中,看看数字k出现的频次是多少。但是这个n,我们并不知道有多大, 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
给定一个数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。 返回滑动窗口中的最大值。 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/sliding- 阅读全文
摘要:
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 阅读全文
摘要:
问题描述: 农夫想去找回他丢失的牛。设农夫当前的位置为N,牛的位置为K。农夫和牛都在数轴上。农夫有两种移动方式: 1.从X移动到X+1或X-1,花费的时间为1 min; 2.从X移动到X*2,花费的时间为1 min; 假设牛不会移动,求农夫最少需要多长时间才能抓到牛。 输入要求: 一行,分别为N和K 阅读全文
摘要:
分班规则: 1)如果分数>=T2, 那么该学生会被分配到A班; 2)如果分数>=T1&&<T2,那么该学生会被分配到B班; 3)如果分数<T1,则该学生会被分配到C班。 4)每班的最小人数不能低于Kmin(>=Kmin),最大人数不能大于Kmax(<=Kmax) 现在,在T1,T2没有给定的情况下, 阅读全文