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>...
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...
ARTS #200 | 参加展览 带着自己的作品参加展览,一路上很兴奋~ Algorithm 本周选择的算法题是:Snapshot Array。 struct SnapshotArray { snapshots: Vec<Vec<(i32, i32)>>, snap_id: i32, } /** * `&self` means the method ta...
ARTS #199 | 家长开放日 第一次参加幼儿园的家长开放日活动,老师带着做早操,活力满满~ Algorithm 本周选择的算法题是:Destroying Asteroids。 impl Solution { pub fn asteroids_destroyed(mass: i32, mut asteroids: Vec<i32>) -> bool { aster...
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:...
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 =...
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 { ...
ARTS #195 | 委托人和代理人 Algorithm 本周选择的算法题是:Maximum Value of K Coins From Piles。 use std::cmp::{min,max}; impl Solution { pub fn max_value_of_coins(piles: Vec<Vec<i32>>, k: i32) -> i32 { le...
脚踏实地、应用 AI 人工智能(AI)已经成为当前社会的热点话题,无论是科技公司还是其他行业都在探索如何利用 AI 技术来获得优势,似乎任何产品只要套上 AI 的壳就像有了一个银弹,但 AI 本身只是一种工具,它需要与产品目标和价值主张相结合才能发挥最大的作用,例如用于自然语言处理,帮助产品更好地理解和响应用户的需求,也可以用于图像识别和推荐算法,帮助产品更好地匹配用户的兴趣。想要帮助产品更好地实现其目标,这一切...
ARTS #194 | AI 不会取代知识分子 Algorithm 本周选择的算法题是:Excel Sheet Column Title。 impl Solution { pub fn convert_to_title(mut column_number: i32) -> String { let mut result: Vec<u8> = Vec::new(); whil...