/string-calculator-challenge

Primary LanguageJavaApache License 2.0Apache-2.0

String Calculator Challenge

The aim of this challenge is to implement a simple integer calculator. The calculator takes a string of space-separated numbers and operators (like "1 + 2 + 3" or "10 + 4 - 5") and returns the result of the calculation.

It should resolve the following sums:

  • "1"
  • "1 + 1"
  • "1 + 2 + 3"
  • "10 - 6"
  • "10 + 5 - 6"
  • "10 * 5"

If an operator isn't known, an exception should be thrown.