Implement round() for Non-Negative Numbers

Implement roundNumber(num) from scratch for non-negative numbers given as a decimal string. The function rounds the last digit half-up and returns the result as a string without using built-in floating-point rounding.

Check more interview questions and experiences about Pinterest

Please log in to view interview question details