DEV Community

Discussion on: Daily Challenge #242 - Expressions Matter

Collapse
 
peter279k profile image
peter279k

Here is the simple solution for PHP:

function expressionMatter($a, $b, $c) {
    $possible_ans = [
      $a * $b * $c,
      $a + $b + $c,
      ($a + $b) * $c,
      $a + $b * $c,
      $a * $b + $c,
      $a * ($b + $c),
    ];

    return max($possible_ans);
}