title: Cassinis Identity
signature: function cassinisIdentity(n: number): number {
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(67, -1);
    console.log(`TEST-0...${result}`);
  
    result = driver(2, 1);
    console.log(`TEST-1...${result}`);
  
    result = driver(58, 1);
    console.log(`TEST-2...${result}`);
  
    result = driver(6, 1);
    console.log(`TEST-3...${result}`);
  
    result = driver(42, 1);
    console.log(`TEST-4...${result}`);
  
    result = driver(17, -1);
    console.log(`TEST-5...${result}`);
  
    result = driver(37, -1);
    console.log(`TEST-6...${result}`);
  
    result = driver(44, 1);
    console.log(`TEST-7...${result}`);
  
    result = driver(23, -1);
    console.log(`TEST-8...${result}`);
  
    result = driver(40, 1);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def cassinis_identity(n):
      return ((- 1) if (n & 1) else 1)
source_cpp: int cassinis_identity(int n) {
    return ( n & 1 ) ? - 1 : 1;
  }