• + 0 comments
    function getMaxLessThanK(n, k) {
      let max = 0;
      let s = [];
    
    
        max = 0;
        for (let a = 1; a <= n; a++) {
          s.push(a);
          for (let b = a + 1; b <= n; b++) {
            let bit = a & b;
            if (bit < k && bit > max) {
              max = bit;
            }
          }
        }
      return max;
    }