Jim and the Orders

  • + 0 comments

    Here is my solution in PHP :

    function jimOrders($orders) {
        // Write your code here
        $hasil_hitung = [];
        $hasil = [];
        
        foreach ($orders as $key=>$val) {
            $hasil_hitung[$key+1] = $val[0] + $val[1];
        }
        
        asort($hasil_hitung);
    
        foreach ($hasil_hitung as $key=>$val) {
            $hasil[] = $key;
        }
        return $hasil;
    
    }