Solving Convert a Number to Hexadecimal in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Note:

  1. All letters in hexadecimal (a-f) must be in lowercase.
  2. The given number is guaranteed to fit within the range of a 32-bit signed integer.

Example 1:

Input:
26

Output:
"1a"

Example 2:

Input:
-1

Output:
"ffffffff"

See the full details of the problem Convert a Number to Hexadecimal at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go