Count Functions

Count Functions

Medium Computer Mathematics Sets, Relations & Functions 26 views
Explanation Complexity

Problem Statement

How many functions from set of size n to set of size m?

Input Format

Two integers n m.

Output Format

One integer (may be huge, output as power form).

Example

3 2
2^3

Constraints

n,m

Input / Output Format

Input Format
Two integers n m.
Output Format
One integer (may be huge, output as power form).
Constraints
n,m

Examples

Input:
3 2
Output:
2^3

Example Solution (Public)

Computer Mathematics
Each of n elements chooses one of m values, so m^n. Output as text m^n if large.

Official Solution Code

Each of n elements chooses one of m values, so m^n. Output as text m^n if large.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.