ARTS #193 | 户外写生 Algorithm 本周选择的算法题是:Count Subarrays With Fixed Bounds。 impl Solution { pub fn count_subarrays(nums: Vec<i32>, min_k: i32, max_k: i32) -> i64 { let mut ans = 0; let ... 2023-03-122 min read
《巴黎评论·作家访谈1》阅读笔记 这本书是讲什么的 这不是一本传统意义上的书,《巴黎评论》是美国的文学杂志,1953年创刊,作家访谈作为招牌栏目,其主要内容为访谈世界文坛最重要的诗人和作家,这一本收录了「卡波蒂、海明威、亨利·米勒、纳博科夫、凯鲁亚克、厄普代克、加西亚·马尔克斯、雷蒙德·卡佛、米兰·昆德拉、罗伯-格里耶、君特·格拉斯、保罗·奥斯特、村上春树、奥尔罕·帕慕克、斯蒂芬·金、翁贝托·埃科」十六位的访谈内容。 ... 2023-03-037 min read
ARTS #192 | AI 上色 Algorithm 本周选择的算法题是:Minimum Depth of Binary Tree。 impl Solution { pub fn min_depth(root: Option<Rc<RefCell<TreeNode>>>) -> i32 { if root.is_none() { return 0 };... 2023-02-254 min read
ARTS #191 | AI 生成网站图片 Algorithm 本周选择的算法题是:Invert Binary Tree。 use std::rc::Rc; use std::cell::RefCell; impl Solution { pub fn invert_tree(root: Option<Rc<RefCell<TreeNode>>>) -> Option<Rc... 2023-02-187 min read
ARTS #190 | 手工兔兔 Algorithm 本周选择的算法题是:Valid Sudoku。 class Solution: def isValidSudoku(self, board: List[List[str]]) -> bool: table = set() for i in range(len(board)): for j in ... 2023-02-122 min read
ARTS #189 | 元宵烟花 Algorithm 本周选择的算法题是:Zigzag Conversion。 impl Solution { pub fn convert(s: String, num_rows: i32) -> String { if num_rows < 2 { return s; } let num_rows = num_r... 2023-02-053 min read
2023 春节记忆 老家的雪在年三十前就铺满了大地,而在厦门这座南方小城,却百花齐放、暖阳高照。 今年因为小宝宝出生,连续两年没回老家,由于无人带娃,年的记忆就和家里的大宝小宝们交织在一起。 压岁钱 不得不说,现在的红包是越来越好看了: 我小时候可收不到这么好看(长)的红包😌 压岁钱的寓意是辟邪驱鬼,帮助小孩平安过年,并祝愿他们能够在新的一年里平平安安。我家大宝理解了这份寓意,给我们制作了一个... 2023-01-281 min read
ARTS #188 | 新年快乐 Algorithm 本周选择的算法题是:Subarray Sums Divisible by K。 规则 Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k. A subarray is a con... 2023-01-227 min read
ARTS #187 | 喂天鹅 Algorithm 本周选择的算法题是:Longest Path With Different Adjacent Characters。 规则 You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes numb... 2023-01-157 min read
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... 2023-01-084 min read