1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

a task for any programmers here

Discussion in 'BlackHat Lounge' started by theseodude, Jan 26, 2013.

  1. theseodude

    theseodude Regular Member

    Joined:
    Jun 25, 2012
    Messages:
    303
    Likes Received:
    88
    my question is hard to describe.

    ok here:
    aa
    ab
    ac
    dl
    pa
    eq
    jt

    I need to list all possibilities. i think there would be 650 of them.
     
  2. guvenor

    guvenor Junior Member

    Joined:
    Aug 11, 2009
    Messages:
    165
    Likes Received:
    89
    <?php
    $set1=range('a', 'z');
    $set2=range('a', 'z');
    foreach($set1 as $first){
    foreach($set2 as $second){
    echo $first.$second." , ";
    }
    }
    ?>
     
    • Thanks Thanks x 1
  3. guvenor

    guvenor Junior Member

    Joined:
    Aug 11, 2009
    Messages:
    165
    Likes Received:
    89
    26 x 26 =676 possibilities
     
    • Thanks Thanks x 1
  4. theseodude

    theseodude Regular Member

    Joined:
    Jun 25, 2012
    Messages:
    303
    Likes Received:
    88
    so you think aa and aa are different? Thanks for the php program, by the way.

    edit: you are absolutely right. 676.
     
    Last edited: Jan 26, 2013
  5. nipunn12

    nipunn12 Regular Member

    Joined:
    May 30, 2011
    Messages:
    372
    Likes Received:
    98
    676 - 26 = 650

    Edit : It's 676 only. AA, BB dont repeat
     
    • Thanks Thanks x 1
    Last edited: Jan 26, 2013