<?php
function sorted($a){
return $a;
} else {
for ($i=1; $i<count($a); $i++){ if ($a[$i] < $a[0])
$l[] = $a[$i];
else
$r[] = $a[$i];
}
}
}
$a = array(11,1,23,45,7,12,4,6,8,43);
PD9waHAKCWZ1bmN0aW9uIHNvcnRlZCgkYSl7CgkJaWYoY291bnQoJGEpPDIpewoJCQlyZXR1cm4gJGE7CgkJfSBlbHNlIHsKCQkJJGwgPSAkciA9IGFycmF5KCk7CgkJCQoJCQlmb3IgKCRpPTE7ICRpPGNvdW50KCRhKTsgJGkrKyl7CgkJCQlpZiAoJGFbJGldIDwgJGFbMF0pCgkJCQkJJGxbXSA9ICRhWyRpXTsKCQkJCWVsc2UKCQkJCQkkcltdID0gJGFbJGldOwoJCQl9CgkJCQoJCQlyZXR1cm4gYXJyYXlfbWVyZ2Uoc29ydGVkKCRsKSwgYXJyYXkoJGFbMF0pLCBzb3J0ZWQoJHIpKTsJCgkJfQoJfQoJCgkkYSA9IGFycmF5KDExLDEsMjMsNDUsNywxMiw0LDYsOCw0Myk7CglwcmludF9yKHNvcnRlZCgkYSkpOw==