ARTS #186 | 阳康了 Algorithm 本周选择的算法题是:Maximum Ice Cream Bars。 规则 It is a sweltering summer day, and a boy wants to buy some ice cream bars. At the store, there are n ice cream bars. You are given an array cost...
ARTS #185 | 圣诞展览 Algorithm 本周选择的算法题是:Walking Robot Simulation II。 规则 A width x height grid is on an XY-plane with the bottom-left cell at (0, 0) and the top-right cell at (width - 1, height - 1). The grid is a...
ARTS #184 | 以后就是四口之家了 Algorithm 本周选择的算法题是:Maximum Difference Between Node and Ancestor。 规则 Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b....
ARTS #183 Algorithm 本周选择的算法题是:Minimum Average Difference。 规则 You are given a 0-indexed integer array nums of length n. The average difference of the index i is the absolute difference between the average...
ARTS #182 Algorithm 本周选择的算法题是:Maximum Profit in Job Scheduling。 规则 We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i]. You’re given t...
ARTS #181 Algorithm 本周选择的算法题是:Ugly Number。 规则 An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return true if n is an ugly number. Example 1: Inp...
ARTS #180 Algorithm 本周选择的算法题是:Maximum 69 Number。 规则 You are given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6 becomes ...
ARTS #179 Algorithm 本周选择的算法题是:Orderly Queue。 规则 You are given a string s and an integer k. You can choose one of the first k letters of s and append it at the end of the string.. Return the lexicographic...
ARTS #178 Algorithm 本周选择的算法题是:Earliest Possible Day of Full Bloom。 规则 You have n flower seeds. Every seed must be planted first before it can begin to grow, then bloom. Planting a seed takes time and so d...
ARTS #177 Algorithm 本周选择的算法题是:Set Mismatch。 规则 You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated...