A movie app prints how long a movie is like 2h 5m. Given the length in minutes, return the text exactly as it should be printed: the hours, h, a space, the leftover minutes, then m.
formatMinutes(125) returns 2h 5m.
You'll need integer division (/, or // in Python) for the hours and the remainder operator % for the minutes. In Python, turn numbers into text with str() before joining them to other text.
totalMinutes is between 0 and 10,000.
Input: formatMinutes(125)
Output: "2h 5m"
Input: formatMinutes(45)
Output: "0h 45m"
Your solution is checked against 2 example tests and 5 hidden tests (edge cases and bigger inputs).
Languages you don't learn in class are worth more: C++ 1.25×, JavaScript, TypeScript, C, Rust and Go 1.5×. Your first solve in a language unlocks its "Learned" achievement: +25 for learning it.
Loading editor...
Run Code checks the example tests. Submit runs every test, including hidden ones.