Algorithm · Upstart · Easy
Problem You are given a non-negative integer n that represents a number of bytes. Your task is to format it into a human-readable string following these rules: If n = 1024*1024, convert to MB (1 MB = 1024 KB). Round the numeric value to two decimal places. The output string must be with a single space between the number and the unit. Input A single integer n. Output A string formatted according to the rules above. Constraints 0 <= n <= 2^31 - 1 Example Explanation: 12345…
Checking your access…