Expression evaluation count

Write codeHard35 minGoogle style

Your task

Given a string of digits 'num' and an integer target, count how many distinct expressions you can form by inserting the binary operators '+', '-', and '*' between digits (concatenating adjacent digits into multi-digit operands) so the expression evaluates to target. Operands may not have leading zeros (so '05' is disallowed, but a single '0' is fine). Standard precedence applies (multiplication binds tighter). 1 <= len(num) <= 10. Return the count.

Examples

count_target_expressions(num: str, target: int) -> int
Example 1
Inputcount_target_expressions("123", 6)
Output2