Problem 1915. GJam 2013 Veterans: Baby Height Prediction
This Challenge is derived from GJam 2013 Veterans Baby Height. Only the first 82 of 5958 test cases are evaluated.
The GJam story goes that a baby's final height can be bounded given its mom's and dad's height(Ht) and its sex. Baby Nominal Ht is (Mom Ht+ Dad Ht + Baby Sex Adj)/2. A boy gets an Adjust of +5" while a girl is -5". The range is +/- 4" from nominal. However, for fractional inches the range is reduced until endpoints are whole inches.
Input: str , String of Sex, Mom and Dad Height x'y"
Output: H , string of Predicted Height Range
Examples: [str] [H]
B 5'11" 6'2" spawns 5'11" to 6'7" G 5'11" 6'2" spawns 5'6" to 6'2" B 3'4" 3'4" spawns 3'3" to 3'10"
Commentary:
1) Provide input like fgetl per test case 2) 15 of 32 entrants completed this Challenge 3) This is a test of regexp and sprintf formatting (or just regexprep)
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
454 Solvers
-
Set the array elements whose value is 13 to 0
1362 Solvers
-
The Answer to Life, the Universe, and Everything
523 Solvers
-
14497 Solvers
-
1295 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!