Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/koko37/challenge-missing-digits
- Owner: koko37
- Created: 2020-11-13T00:51:18.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T00:56:45.000Z (almost 4 years ago)
- Last Synced: 2024-10-11T08:24:34.626Z (27 days ago)
- Topics: coderbyte, coderbyte-solutions, javascript
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 9
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```