AlaaShaker's Weblog

// untitled …

Posts Tagged ‘Permutation

Alphabetic Phone Number Generator SOLVED [Problem of the Week]

with 4 comments

It’s been a while, huh? Well, for the second time, my apologies!

Anyway, the past problem was of medium difficulty, but there’s a trick that could make your life much easier. Do you know what a permutation is? This is a permutation problem. A definition of permutation is that a permutation of [ABC] is simply [ABC – ACB – BAC – BCA – CAB – CBA] .. all possible arrangements of the three letters. Think of our problem the same way, you just need all possible arrangements for the three characters corresponding to each number. Easier? Thanks to Abdalla Gamal for making our lives easier.

So, similar to the ACM problems, we’ll solve the standard permutation problem, where we get to print all possible arrangements of a set of digits. Then, we transform that to our problem. Read the rest of this entry »

Written by AlaaShaker

October 18, 2008 at 6:09 am