Top Stories published by 數據共筆 in March of 2023

Leetcode:(String)(Python)Count Binary Substrings

題目連結:https://leetcode.com/problems/count-binary-substrings/description/

題目會給出一個只有0和1的字串,要找出能夠組成幾個數量一致的子組合,譬如01, 0011, 10, 1100等


LeetCode:(Python) Happy Number

題目連結: https://leetcode.com/problems/happy-number/

題意說明:

將數字中的個位數平方+十位數平方+...後會獲得新數字,不斷重複

如果最後獲得1,return True