# Day 6: Bitwise Operators

### Problem Link <a href="#problem" id="problem"></a>

* [x] [**HackerRank Problem Link**](https://www.hackerrank.com/challenges/js10-bitwise/problem)

### Solution

* [x] **JS Solution**

{% code title="bitwiseOp.js" %}

```javascript
function getMaxLessThanK(n, k) {
  let max = 0;
  for (let i = 1; i <= n; i++) {
    for (let j = i + 1; j <= n; j++) {
      (i & j) > max && (i & j) < k ? (max = i & j) : max;
    }
  }
  return max;
}
```

{% endcode %}
