Security Involution

Sort by

recency

|

30 Discussions

|

  • + 0 comments

    js

    function processData(input) {
        //Enter your code here
        let arr = (input.split(`\n`)[1].split(' ').map(e => Number(e)))
        let c =0;
            
        let keys = [...arr.keys()]
        for(let key in  keys){
            if(arr.findIndex(n => n==(Number(key) +1))+1 == arr[Number(key)])
                c++;
        }
        if(Number(c)==arr.length )
            console.log("YES");
        else
            console.log("NO");
    } 
    
  • + 0 comments

    I was extremely satisfied to discover this site.I needed to thank you for this incredible read!! I certainly getting a charge out of each and every piece of it and I have you bookmarked to look at new stuff you post. yoga burn coupon

  • + 0 comments

    I need to express profound gratitude to you. I have bookmark your site for future updates. unlock your hip flexors coupon

  • + 0 comments

    I was extremely satisfied to discover this site.I needed to thank you for this incredible read!! I certainly getting a charge out of each and every piece of it and I have you bookmarked to look at new stuff you post. resurge coupon

  • + 0 comments

    php solution because why not...

    $_fp = fopen("php://stdin", "r");
    
    $n = fgets($_fp);
    $set = explode(' ', fgets($_fp));
    $set = array_combine(range(1, count($set)), $set);
    $involution = true;
    
    foreach ($set as $k => $v) {
        if ($k !== intval($set[$v])) {
            $involution = false;
            break;
        }
    }
    
    echo ($involution ? "YES" : "NO") . PHP_EOL;