Security Function Inverses

Sort by

recency

|

68 Discussions

|

  • + 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))
    
  • + 0 comments

    A little hint : Try to get the index.