Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koko37/challenge-missing-digits

Code challenge (resolve missing digits)
https://github.com/koko37/challenge-missing-digits

coderbyte coderbyte-solutions javascript

Last synced: 10 days ago
JSON representation

Code challenge (resolve missing digits)

Awesome Lists containing this project

README

        

### Missing Digit
Have the function MissingDigit(str) take the str parameter, which will be a simple mathematical formula with three numbers, a single operator (+, -, *, or /) and an equal sign (=) and return the digit that completes the equation. In one of the numbers in the equation, there will be an x character, and your program should determine what digit is missing. For example, if str is "3x + 12 = 46" then your program should output 4. The x character can appear in any of the three numbers and all three numbers will be greater than or equal to 0 and less than or equal to 1000000.

#### Examples

```
Input: "4 - 2 = x"
Output: 2
Input: "1x0 * 12 = 1200"
Output: 0
```