Leetcode—3516. 找到最近的人【简单】
2025每日刷题(230)
Leetcode—3516. 找到最近的人
实现代码
class Solution {
public:int findClosest(int x, int y, int z) {int one = abs(x - z);int two = abs(y - z);if (one > two) {return 2;} else if (one < two) {return 1;} else {return 0;}}
};
运行结果
之后我会持续更新,如果喜欢我的文章,请记得一键三连哦,点赞关注收藏,你的每一个赞每一份关注每一次收藏都将是我前进路上的无限动力 !!!↖(▔▽▔)↗感谢支持!