You are given an integer num, convert it to hexadecimal. For negative integers, the two's complement method is used.
The hexadecimal string should not contain any extra leading zeros. If the number is zero, its hexadecimal representation is "0". All letters in the hexadecimal string (a-f) should be lowercase.
You may not use any built-in library's functions that directly convert an integer to a hexadecimal string.
26
"1a"
26 in decimal is 1a in hexadecimal.
-1
"ffffffff"
-1 in decimal, using two's complement for a 32-bit integer, is ffffffff in hexadecimal. This represents the maximum 32-bit unsigned integer value.
0
"0"
0 in decimal is 0 in hexadecimal.
26
"1a"