title: Efficient Way To Multiply With 7
signature: function efficientWayToMultiplyWith7(n: number): number {
source_py: def efficient_way_to_multiply_with_7(n):
      return ((n << 3) - n)
source_cpp: long efficient_way_to_multiply_with_7(long n) {
    return ( ( n << 3 ) - n );
  }
question_info.test_list: [{"idx": 0, "outputs": 287, "inputs": {"n": 41}}, {"idx": 1, "outputs": 294, "inputs": {"n": 42}}, {"idx": 2, "outputs": 434, "inputs": {"n": 62}}, {"idx": 3, "outputs": 28, "inputs": {"n": 4}}, {"idx": 4, "outputs": 217, "inputs": {"n": 31}}, {"idx": 5, "outputs": 525, "inputs": {"n": 75}}, {"idx": 6, "outputs": 35, "inputs": {"n": 5}}, {"idx": 7, "outputs": 525, "inputs": {"n": 75}}, {"idx": 8, "outputs": 595, "inputs": {"n": 85}}, {"idx": 9, "outputs": 133, "inputs": {"n": 19}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(41, 287);
    console.log(`TEST-0...${result}`);
  
    result = driver(42, 294);
    console.log(`TEST-1...${result}`);
  
    result = driver(62, 434);
    console.log(`TEST-2...${result}`);
  
    result = driver(4, 28);
    console.log(`TEST-3...${result}`);
  
    result = driver(31, 217);
    console.log(`TEST-4...${result}`);
  
    result = driver(75, 525);
    console.log(`TEST-5...${result}`);
  
    result = driver(5, 35);
    console.log(`TEST-6...${result}`);
  
    result = driver(75, 525);
    console.log(`TEST-7...${result}`);
  
    result = driver(85, 595);
    console.log(`TEST-8...${result}`);
  
    result = driver(19, 133);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: efficientWayToMultiplyWith7
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js