Skip to content

Commit d674a36

Browse files
authored
Create BitwiseOperators.js
1 parent cb49c60 commit d674a36

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

BitwiseOperators.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var getMaxLessThanK= function(n,k){
2+
let max_v=0;
3+
for(var i=1;i<n;i++){
4+
for(var j=i+1;j<n+1;j++){
5+
if(Number(i&j)<k && Number(i&j)>max_v)
6+
max_v=i&j;
7+
}
8+
}
9+
return max_v
10+
}

0 commit comments

Comments
 (0)