MAT

Riddle #5

Find the largest palindromic number less than M which is the product of two numbers of three digits.

Constraints

105 < M < 106

Example

If M = 101102 The largest palindrome is generated by the three digit numbers:
143, 707
and it is: 101102

Your program

<?php
    
function main($M) {

  $return = 0;
  /* Write your function here */
  
  return $return;
}
  
$IN = (array) json_decode(base64_decode($argv[1]));
extract($IN);
echo main($M);
?>

Your input

{ 
  "M": 101102 
}

Your output

-

Correct output

101101

0 0 votes
Article Rating
Notifiche
Notificami
0 Comments
Inline Feedbacks
View all comments