Expand tabs

Write codeMedium15 min

Your task

A log viewer renders tabs with 4-column tab stops. Given a single line (no newlines), replace each tab with one to four spaces so that the character after the tab lands on the next multiple of 4, counting columns from 0 over the output produced so far. All other characters occupy one column each. For example, 'ab\tc' becomes 'ab c' (two spaces bring column 2 to 4), and '\t' alone becomes four spaces.

Examples

expand_tabs(line: str) -> str
Example 1
Inputexpand_tabs("ab\tc")
Output"ab c"