Security Permutations

  • + 0 comments

    PHP solution...

    $_fp = fopen("php://stdin", "r");
    
    $n = fgets($_fp);
    $set = explode(' ', fgets($_fp));
    
    foreach($set as $v) {
        echo $set[$v-1] . PHP_EOL;
    }