Describe an algorithm that determines whether a function from a finite set to another finite set is one-to-one.

Solution Step 1:Consider the two sets and , and .Then keep a count for each element in ,setting count to zero.For each compute and add one to count.If any b has count of 1 then it is not one-to-one otherwise it is one-to-one.