Decimal to Base-N

Develop a Python function to transform a decimal number to its equivalent in a different numeric base.

The task is about the conversion of decimal numbers to different numerical systems such as binary or hexadecimal systems, which is an essential operation in the world of programming. You are expected to create a Python function for this conversion. The function will take in a decimal number `M` and the base `N` to which this decimal number is to be converted. For bases that are greater than 9, the function should adhere to a hexadecimal notation where 'A' is equated to 10, 'B' to 11 and so on. ### Parameters - `M`: This is the decimal number to be converted. It is a positive integer. - `N`: This is the base to which `M` is converted. It is an integer that falls within the range of 2 to 16 (2 ≤ N ≤ 16). ### Return Value - The function is expected to return a string which represents the number in base `N` format. ### Examples ```python # The decimal number 7 is equivalent to 111 in binary (base 2) solution(7, 2) # Expected output: '111' # The decimal number 888 is equivalent to 378 in base 16 (hexadecimal) solution(888, 16) # Expected output: '378' # The decimal number 33 is equivalent to 21 in base 16 (hexadecimal) solution(33, 16) # Expected output: '21' ```