- Notifications
You must be signed in to change notification settings - Fork278
Open
Description
I tried your code of 190 and it didn't pass.
I recommend my solution:
/** *@param {number} n - a positive integer *@return {number} - a positive integer */varreverseBits=function(n){vars=n.toString(2).split(""),c="";for(i=0;i<32;i++){if((s[s.length-1-i]=="0")||(s[s.length-1-i]=="1"))c=c+s[s.length-1-i];elsec=c+"0";}returnparseInt(c,2);};
Metadata
Metadata
Assignees
Labels
No labels