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