Back to problems

Reach a Target by Inserting Addition or Multiplication Left to Right

Algorithm · Pinterest · Medium

Evaluate Expression Left-to-Right Medium · Topics: Backtracking · Company Tags · Hints You are given an array arr of n integers and an integer target. You may place exactly one operator—either addition (+) or multiplication (*)—between every pair of consecutive numbers. The numbers themselves must stay in the original order. Once placed, the whole expression is computed strictly from left to right, ignoring the usual rule that multiplication has higher precedence than…

Checking your access…