Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

function sockMerchant($n, $ar) { $b=array(); $number_socks=0; for($i=0;$i<$n;$i++)..

Decoded Output download

<?  function sockMerchant($n, $ar) { 
$b=array(); 
	$number_socks=0; 
	 
	for($i=0;$i<$n;$i++) 
	{ 
		$b[$ar[$i]]++; 
	} 
	foreach($b as $key => $val) 
	{ 
		 $number_socks+=intdiv($val,2); 
	} 
	return $number_socks; 
} 
 
$n=9; 
$ar_temp='10 20 20 10 10 30 50 10 20'; 
$ar = array_map('intval', preg_split('/ /', $ar_temp, -1, PREG_SPLIT_NO_EMPTY)); 
 
print $result = sockMerchant($n, $ar); 
 ?>

Did this file decode correctly?

Original Code

function sockMerchant($n, $ar) {
$b=array();
	$number_socks=0;
	
	for($i=0;$i<$n;$i++)
	{
		$b[$ar[$i]]++;
	}
	foreach($b as $key => $val)
	{
		 $number_socks+=intdiv($val,2);
	}
	return $number_socks;
}

$n=9;
$ar_temp='10 20 20 10 10 30 50 10 20';
$ar = array_map('intval', preg_split('/ /', $ar_temp, -1, PREG_SPLIT_NO_EMPTY));

print $result = sockMerchant($n, $ar);

Function Calls

None

Variables

$n 9
$ar_temp 10 20 20 10 10 30 50 10 20

Stats

MD5 2eba29f7474f06faa31dc33127ada36e
Eval Count 0
Decode Time 91 ms