/operate-execute

Primary LanguageGoMIT LicenseMIT

operate-execute

Given a statement list of numbers and operations, execute the given statement.

func execute(statement []string) int

Examples:

# 4 / 2 = 2
execute([4, "/", 2])
2
# 1 * 2 + 3 = 5
execute([1,"*",2,"+",3])
5