惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
D
DataBreaches.Net
G
Google Developers Blog
博客园 - Franky
V
V2EX
博客园 - 叶小钗
D
Docker
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
月光博客
月光博客
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
V
Visual Studio Blog
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
J
Java Code Geeks
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
C
Check Point Blog
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
B
Blog
小众软件
小众软件
云风的 BLOG
云风的 BLOG
I
InfoQ
Recorded Future
Recorded Future
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队

ABB00717

medusa 找不到 ssh module 中文文案排版指北 BugBounty Playbook 小知識 透過 Ubuntu 26 設定 Windows 11 雙系統並使用 Image Recovery 之踩坑全紀錄 清除 git history 中的機敏資料 編譯器筆記 部落格聚集地 HTB - Busqueda 396. Rotate Function 幫耳機補血! 紀錄/週刊/ 做過的夢(旅行) 做過的夢 週刊 Vol.18 週刊 Vol.17 週刊 Vol.16 做過的夢(火箭推進器和追蹤導彈) 在 Ubuntu 24.04 中安裝 python2 和 pip2 動態牆 紀錄/音樂/ 用 miniflux 和 Cloudflare Tunnel 自架 RSS Reader 週記 Vol.15 關於用了 GCC 擴充功能,而被批評不夠 Clean Code 這檔事 GDB Makefile HTB - TwoMillion 週記 Vol.14 紀錄/Hack-The-Box/ 週記 Vol.13 ABB00717's Blog 1980. Find Unique Binary String 週記 Vol.12 紀錄/Leetcode/ 在互聯網上,什麼該說,什麼又不該說? 週記 Vol.8 週記 Vol.7 週記 Vol.6 天才之於一種義務 就算 LLM 能解答所有問題,你也不該放棄學習 Stack-Based Buffer Overflow 筆記/書籍/ 《絕佳時間》 週記 Vol.5 偽深刻的自我解構 筆記/Linux-雜項筆記/ 解決 Ubuntu 待機後喚醒異常的問題 將應用程式新增到 GNOME 的 Activities Overview 週記 Vol.4 Assembly Language 週記 Vol.3 筆記/ 文章/ 紀錄/ 資源/ 挑戰 週記 Vol.2 部落格該有的東西 週記 Vol.1 數學符號表 Advent of Code Day 8 Advent of Code Day 7 Obsidian 無痛轉成 Blog Advent of Code Day 6
788. Rotated Digits
2026-05-02 · via ABB00717

    閱讀時間約 1 分鐘

    原本想算數學,後來發現 ,就直接照著直覺硬幹了。

    from math import floor
     
     
    class Solution:
        def rotatedDigits(self, n: int) -> int:
            result = 0
            for num in range(1, n + 1):
                # 'e' represent end of string
                s = str(num) + "\0"
     
                # If the number remain unchanged after switching
                diff = False
                for c in s:
                    if c in ["0", "1", "8"]:
                        continue
                    elif c in ["2", "5", "6", "9"]:
                        diff = True
                        continue
                    elif c == "\0" and diff:
                        result += 1
     
                    break
     
            return result

    此網頁的永久連結:https://blog.abb00717.com/p/26090b