Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.
Click here
If number is negative add 2^32 to it to get two's complement. Iterate over number, add mod 16 to result, and divide number by 16 each time. O(n) time, O(n) space.Run make to run python and Swift files.