企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
Given an integer, write a function to determine if it is a power of two. ~~~ public class Solution { public boolean isPowerOfTwo(int n) { int x=0; while(n>0){ x += (n&1); n>>=1; } return x==1; } } ~~~