We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7ba820 commit 1169475Copy full SHA for 1169475
Hackerrank solutions/10 days of js/Bitwise_Operators.js
@@ -0,0 +1,38 @@
1
+'use strict';
2
+
3
+process.stdin.resume();
4
+process.stdin.setEncoding('utf-8');
5
6
+let inputString = '';
7
+let currentLine = 0;
8
9
+process.stdin.on('data', inputStdin => {
10
+ inputString += inputStdin;
11
+});
12
13
+process.stdin.on('end', _ => {
14
+ inputString = inputString.trim().split('\n').map(string => {
15
+ return string.trim();
16
+ });
17
18
+ main();
19
20
21
+function readLine() {
22
+ return inputString[currentLine++];
23
+}
24
25
+function getMaxLessThanK(n,k)
26
+{
27
+ let max=0
28
+ for(let i=1;i<n;i++)
29
+ for(let j=i+1;j<=n;j++)
30
+ {
31
+ let and=i&j
32
33
+ if(and<k && and>max)
34
+ max=and
35
+ }
36
+ return max
37
38
0 commit comments