A 边界上的蚂蚁 模拟 class Solution {
public:int returnToBoundaryCount(vector<int> &nums) {int s 0;int res 0;for (auto x: nums) {s x;if (s 0)res;}return res;}
};B 将单词恢复初始状态所需的最短时间 I 枚举:若经过 i i i 秒后 w o r d w…
二、进阶使用
性能提升——协程
GoRoutine
go f();一个 Go 线程上,可以起多个协程(有独立的栈空间、共享程序堆空间、调度由用户控制)主线程是一个物理线程,直接作用在 cpu 上的。是重量级的,非常耗费 cpu 资源。协…