theeddieh / operate-execute

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

License:MIT License


Languages

Language:Go 100.0%