摘要: 题意 一个数n, 若为偶数, 则除2, 若为奇数, 则加减1; 求其最终为1, 需要几步 方法 位运算 代码 class Solution { public: int integerReplacement(int n) { if(n==1) return 0; int result=0; while 阅读全文
posted @ 2022-12-05 20:28 Figure_at_a_Window 阅读(23) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示