In a Birlasoft QA automation utility, numeric values may need to be represented in binary for validation and low-level test checks. Given a non-negative decimal integer, return its binary representation as a string without using the built-in base-conversion functions such as bin().
Implement decimal_to_binary(n), where n is an integer greater than or equal to zero. Return a string containing the binary digits of n, with no leading zeroes except that zero itself must return "0".
Use repeated division by two: the remainder from each division is the next binary digit, starting from the least significant digit. Reverse the collected remainders before returning the result.
def decimal_to_binary(n):