Security Function Inverses

Sort by

recency

|

69 Discussions

|

  • + 0 comments
    because i like php XD
    $_fp = fopen("php://stdin", "r");
    $n = fgets($_fp);
    $nums = fgets($_fp);
    
    $flipped = array_flip(explode(' ', $nums));
    $k1 =  array_map(function ($n) { return $n + 1; }, $flipped);
    ksort($k1);
    echo implode("\n", $k1);
    
  • + 0 comments

    js

    function processData(input) {
        //Enter your code here
        let numbers = input.split(`\n`)[1].split(` `);
        let keys = [...numbers.keys()]
        for(let key in  keys){
            console.log(numbers.findIndex(n => n==(Number(key) +1))+1)
        }
    } 
    
  • + 0 comments

    Many variations of the same theme...

    n = int(input())
    
    inv = [0] * (n+1)
    for x,y in enumerate(map(int, input().split()),1):
        inv[y] = x
    print(*rev[1:], sep = '\n')
    
  • + 0 comments

    Python solution is simple...

    n = int(input())
    nums = map(int, input().split())
    
    output = sorted(enumerate(nums, 1), key=lambda x: x[1])
    
    print('\n'.join(str(x[0]) for x in output))
    
  • + 0 comments
    n = int(input().strip())
    f = [0] + list(map(int, input().strip().split()))
    
    for i in range (1, n+1):
            print(f.index(i))