Algorithms & Data Structureshard
Decide Target via Subsequence Plus/Multiply Expression
Given an array of positive integers nums and a target T: can you choose a subsequence (keep relative order, at least one element) and insert + or * between consecutive chosen elements — standard precedence, * binds first — so the expression equals T?
canReachTarget([2, 3, 5], 11) -> true // 2*3 + 5 canReachTarget([2, 3, 5], 17) -> true // 2 + 3*5 canReachTarget([2, 3, 5], 13) -> false // no subsequence works