Hexadecimal and Hexatrigesimal Conversion

You are given an integer n.

Return the concatenation of the hexadecimal representation of n^2 and the hexatrigesimal representation of n^3.

A hexadecimal number is defined as a base-16 numeral system that uses the digits 0 – 9 and the uppercase letters A - F to represent values from 0 to 15.

A hexatrigesimal number is defined as a base-36 numeral system that uses the digits 0 – 9 and the uppercase letters A - Z to represent values from 0 to 35.

Example 1
Inputn = 13
Output"A91P1"
The hexadecimal representation of 13^2 is "A9", the hexatrigesimal representation of 13^3 is "1P1", and their concatenation is "A91P1".
Example 2
Inputn = 36
Output"5101000"
The hexadecimal representation of 36^2 is "510", the hexatrigesimal representation of 36^3 is "1000", and their concatenation is "5101000".

Constraints

  • 1 <= n <= 1000

Asked at 1 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate