ARTS #205 | 县升市 老家变化很大,从县升到市,街道、基建、路面,还有人,似乎都变得和以前不一样了。 Algorithm 本周选择的算法题是:Split a String in Balanced Strings。 use std::collections::HashMap; impl Solution { pub fn balanced_string_split(s: String) ... 2023-08-203 min read
ARTS #204 | 回老家了 2 年没回家了,这次带 2 个娃回家感受下暑假~ Algorithm 本周选择的算法题是:[Soup Servings](https://leetcode.com/problems/soup-servings/)。 use std::collections::HashMap; impl Solution { pub fn soup_servings(n: i32)... 2023-08-065 min read
ARTS #203 | AI 线描上色真好玩 AI 线描上色真好玩~ Algorithm 本周选择的算法题是:Knight Probability in Chessboard。 impl Solution { pub fn knight_probability(n: i32, k: i32, row: i32, column: i32) -> f64 { let mut dp = vec!... 2023-07-237 min read
ARTS #202 | 1111天 扇贝打卡 1111 天了,继续加油~ Algorithm 本周选择的算法题是:Find All K-Distant Indices in an Array。 impl Solution { pub fn find_k_distant_indices(nums: Vec<i32>, key: i32, k: i32) -> Vec<i32>... 2023-07-094 min read
ARTS #201 | 小蜜蜂 端午在海边画了只小蜜蜂 Algorithm 本周选择的算法题是:Number of Substrings With Only 1s。 impl Solution { pub fn num_sub(s: String) -> i32 { const MODULO: i64 = 10_i64.pow(9) + 7; let (mut... 2023-06-243 min read
ARTS #200 | 参加展览 带着自己的作品参加展览,一路上很兴奋~ Algorithm 本周选择的算法题是:Snapshot Array。 struct SnapshotArray { snapshots: Vec<Vec<(i32, i32)>>, snap_id: i32, } /** * `&self` means the method ta... 2023-06-106 min read
ARTS #199 | 家长开放日 第一次参加幼儿园的家长开放日活动,老师带着做早操,活力满满~ Algorithm 本周选择的算法题是:Destroying Asteroids。 impl Solution { pub fn asteroids_destroyed(mass: i32, mut asteroids: Vec<i32>) -> bool { aster... 2023-06-0310 min read
ARTS #198 | 龙船花 Algorithm 本周选择的算法题是:Maximize Score After N Operations。 impl Solution { pub fn max_score(nums: Vec<i32>) -> i32 { let mut dp = vec![-1; 1 << nums.len()]; Self:... 2023-05-214 min read
ARTS #197 | 看了个球 Algorithm 本周选择的算法题是:Number of Strings That Appear as Substrings in Word。 impl Solution { pub fn num_of_strings(patterns: Vec<String>, word: String) -> i32 { let mut count =... 2023-05-074 min read
ARTS #196 | 养了条鱼 Algorithm 本周选择的算法题是:Find N Unique Integers Sum up to Zero。 impl Solution { pub fn sum_zero(n: i32) -> Vec<i32> { let mut result = vec![]; if n % 2 == 1 { ... 2023-04-305 min read