To Hex Problem
To Hex Problem — ExecCode School DSA Practice
Solve the To Hex problem on ExecCode. Free online school DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given an integer, convert it to its hexadecimal representation. Your task is to solve To Hex. For negative numbers, use 2's complement representation as a 32-bit integer.
Examples
Input 26; Output 1a. Input -1; Output ffffffff
Constraints
1 <= n <= 10^5
Practice To Hex free on ExecCode. Browse DSA problems, topic map, and placement guides.