Contents

ARST打卡第308周

Algorithm

lc2109_向字符串添加空格

思路:

很简单,直接开一个新的字符串,然后让空字符串和原来的字符串进行merge即可,每次遍历到指定的index就可以append一次空格。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
impl Solution {
    pub fn add_spaces(s: String, spaces: Vec<i32>) -> String {
        let mut res = String::with_capacity(s.len() + spaces.len());
        let mut i = 0;
        for space in spaces {
            res.push_str(&s[i..space as usize]);
            res.push(' ');
            i = space as usize;
        }
        res.push_str(&s[i..]);
        res
    }
}

Review

【TED演讲】我们可以重新规划生命

讲了一些基因改造生育和自然进化并存的事情,主要是讲如果合规使用基因改造而不滥用。

Tip

sns.id

20usdc 可以无限使用的域名,还挺舒服的. 兼顾 web3 的钱包地址和 web2 的域名转发。

Share

优秀mcp验网产品分享:

  • cursor 代码编辑器
  • mcp.so 多种mcp网页体验站
  • manus 不断迭代帮你直接生产完整解决方案