SHARE
TWEET

Untitled

a guest Apr 18th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function second_solution($xs) {
  2.     if (!is_array($xs)) return null;
  3.  
  4.     foreach ($xs as $entry) {
  5.         if (!isset($max)) $max = $entry;
  6.         if (!is_array($entry) and $entry > $max) $max = $entry;
  7.         if (is_array($entry)) $max = second_solution($entry);
  8.     }
  9.  
  10.     return $max;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top