Treat n as a 32-bit unsigned integer and split it into 32/k consecutive groups of k bits, where k divides 32. Reverse the order of those groups and return the resulting 32-bit value. With k = 1 every individual bit is reversed, which is the classic 32-bit bit-reversal; with k = 8 the four bytes are reversed, which is a byte-order (endianness) swap.
Input: A JSON object {"n": <32-bit unsigned integer>, "k": <group size>} where k is one of 1, 2, 4, 8, 16, 32.
Output: Return the 32-bit value with its k-bit groups in reverse order.
Input: {"n":43261596,"k":1}
Output: 964176192
Explanation: Reversing all 32 bits of 43261596 gives 964176192.Input: {"n":305419896,"k":8}
Output: 2018915346
Explanation: The bytes of 0x12345678 reverse to 0x78563412.0 <= n < 2^32k divides 32, so k is one of 1, 2, 4, 8, 16, 32