两数之和 day3 控制链基础使用 原题 用数组中两个数值(不能重复)相加得到与target相同的值并返回下标 //力扣 两数之和 数组nums中两数之和值为target 返回两数下标 struct Solution; impl Solution { pub fn two_sum(nums:Vec<i32>,target:i32)-> Vec<… gtchases | 2025-9-21 9:15 | 2025-9-21 9:14 | 60 | 2 | rust任务提交区,rust学习 275 字 | 4 分钟
思考题 day 2 原题 实现一个签名函数to_static_str让它的返回值生命周期为 'static fn to_static_str(s:String)->&'static str { } fn main { let s = "xxx"; let s1 = to_static_str(s.clone); assert(s==s… gtchases | 2025-9-19 4:59 | 2025-9-19 4:56 | 65 | 2 | rust任务提交区 382 字 | 4 分钟