Re: [闲聊] 每日leetcode

楼主: sixB (6B)   2025-04-11 22:17:53
2999.
露西亚:帮写HARD阿阿阿阿阿阿阿
好好好
其实我觉得这题
应该也没到hard
就数数字
你版版主最会了
各种 case一直差1 被弄的很躁==
不过本质都差不多
先找final范围里的个数
再找start范围里的
两个相减
// 1 <= start <= finish <= 1e15
// 1 <= limit <= 9
// 1 <= s.length <= floor(log10(finish)) + 1
// s only consists of numeric digits which are at most limit.
// s does not have leading zeros.
using ll = long long;
class Solution {
public:
ll numberOfPowerfulInt(ll start, ll finish, int limit, string s) {
ll val = stoll(s);
ll t =
作者: JIWP (JIWP)   2025-04-11 22:18:00
大师
楼主: sixB (6B)   2025-04-11 22:19:00
乱讲start先-1是因为 等于start的那个数也可以算 不用扣掉
作者: Rushia (みけねこ的鼻屎)   2025-04-11 22:33:00
你很棒
作者: oin1104 (是oin的说)   2025-04-11 22:35:00
大师 我直接不会

Links booklink

Contact Us: admin [ a t ] ucptt.com