Skip to content

koko37/challenge-missing-digits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

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

About

Code challenge (resolve missing digits)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published