Algorithm · Pinterest · Medium
Requirements Part 1. Build an integer-rounding routine for a decimal string without relying on built-in numeric conversion. It should round to the closest whole number using either banker's rounding (ties go to even) or ordinary half-up rounding; ask the interviewer which tie policy is expected. Part 2. Implement round_to(s, p) with p representing a power-of-ten precision written as a string: s='18431', p='100' → '18400' s='98.764', p='0.1' → '98.8' Do not convert the values…
Checking your access…