the_pyhulk's blog

By the_pyhulk, 14 months ago, In English

Hey everyone,

We are thrilled to announce that Turing Hut, the coding club of VNR VJIET is conducting a national-level coding contest — TURING CUP. The contest is designed to test your coding skills, creativity, and problem-solving abilities.

The contest will be conducted in three rounds. The first round will be an online round conducted on 11th March, 2023. The second round and the third round will be held on-site on 25th March 2023, which will be conducted in the VNR VJIET campus, Hyderabad. Accommodation will be provided for teams whose college is not located in Hyderabad.

The contest is open to all the undergraduate students from across the country who are passionate about coding. We encourage you to participate in the contest and showcase your talent.

To participate in the contest, you need to register yourself at Unstop. The registration for the first round will be open until March 8th, 2023. The first round will be conducted online, and the registered participants will receive further instructions via email.

We urge you to register for the contest and showcase your coding skills to the nation. It's an excellent opportunity for you to learn, network, and grow in your career.

Know more

Register here

Happy coding, Team Turing Hut.

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it

By the_pyhulk, 20 months ago, In English

Results of Both the Kanpur and Gwalior has been released and Amritapuri is yet to release!!

Kanpur Result of Preliminary Online Contest — Kanpur

Amritapuri Result of Preliminary Online Contest — Amritapuri Check under preliminary round tab.

Gwalior Result of Preliminary Online Contest — Gwalior

Full text and comments »

  • Vote: I like it
  • -21
  • Vote: I do not like it

By the_pyhulk, 21 month(s) ago, In English

Amritapuri:-

  • Online Registration Start : July 28th, 2022
  • Registration fees per team, to participate in the online round is INR 600
  • Payment Link
  • Last date to register & pay the fees: 19th August,2022
  • Practice Contest: 21st August, Sunday, 08:00 PM to 10:30 PM.
  • Preliminary Round 2021: 23rd August, Tuesday, 08:00 PM to 10:30 PM
  • Website Link
  • Registration fees per team, to participate in the onsite round is INR. 2650 /-
  • ICPC Asia Amritapuri Onsite Regional 2021:- September 17, 18. to be held at Amritapuri & Bengaluru campuses.
  • Total slots: 135 -- Amritapuri: 75 Bengaluru: 60

Kanpur:-

  • Registration Starts:3 August 2022
  • Registration fees per team, to participate in the online round is:-
  1. For Teams from India: Rs. 1,000/-
  2. For Teams from Other Countries: US$ 200/-
  • Transfer the registration fee using NEFT/RTGS or Online Remittance (Paytm, BHIM, GooglePay etc.) to
  1. Bank Name: State Bank of India
  2. Account Number: 30079117878
  3. Account Name: ACM- KANPUR
  4. IFSC Code: SBIN0001161
  5. Branch- IIT Kanpur
  • Fill all the information in the google form along with screenshot/photograph of registration fee transaction proof.
  • Do not forget to write down the UTR Number/Reference Number (Transaction Number) for your transaction in the registration form and attach the screen shot/ photograph of your transaction.
  • Registration Fee for Onsite Round is INR 4,000/-
  • Website Link

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it

By the_pyhulk, history, 2 years ago, In English

Method 1:- RECURSIVE APPROACH

In this method there are only two basic insights whether to ‘take’ or ‘not take’.

var subsets = function(nums) { let res=[] // the final arr, which we will display let auxArr = [], i=0 // global vars

function recur(nums,i,auxArr){
    if(i==nums.length) { res.push(auxArr); return } //operation of recursion will be upto i=n-1
                               // when it will hit, i==n, it will store the computed arr, in the final arr, and break(return)

    // take it
    recur(nums, i+1, [...auxArr, nums[i] ] )
    // dont take
   recur(nums, i+1, auxArr)

}

recur(nums,i,auxArr) // passing the global variable declared already
return res        // return the final 2d arr

};

                  1 2 3

/ \ 1 [] / \ /. \ 1 2 1 2. [] / \ / \ / \ / \ 123. 12. 13. 1. 23. 2. 3. [].

All the left hand parts are the results of ‘take it’ and right hand are ‘don’t take it’

Method 2:- ITERATIVE APPROACH

var subsets = function(nums) { let res = [[]], appendarr= []

for(let num of nums){
    appendarr = []
    for(let entry of res){
        appendarr.push([...entry, num])
    }

    res.push(...appendarr)
}

return res

};

0 (Empty) : [] 1 (Adding 1 to it) : [] [1] 2 (Adding 2 to it) : [] [1] [2] [1,2] 3 (Adding 3 to it) : [] [1] [2] [1,2] [3] [1,3] [2,3] [1,2,3]

Method 3:- BIT MASKING

var subsets = function(nums) { const result = []; result.push([]); // handling the first case (i=0). for that, an empty arr should be there

let size = nums.length

for(let i = 1; i < (1<<size) ; i++){ // generating for range upto [(2^n)-1] let subset = []; let bitmask=0

while(bitmask<size){
      if(i & (1 << bitmask)){           // if it exists (not zero)
          subset.push( nums[bitmask] );
      }
      bitmask++   
  }
  result.push(subset)

} return result };

Lets Dry Run our code:-

So lets take nums=[1,2,3] we will be searching all elem from 0-> 2^n

so, checking :

i
⬇ while(bitmask<size)

0 [000] [ ]

1 [001] i=1.
i 001 001 001 mask 001 010 100 ---- ---- ---- [001] 000 000

2 [010] i=2.
i 010 010 010 mask 001 010 100 — — --- 000 [010] 000

3 [011] i=3.
i 011 011 011 mask 001 010 100 — — --- [001] [010] 000

4 [100] i=4.
i 100 100 100 mask 001 010 100 — — --- 000 000 [100]

5 [101] i=5.
i 101 101 101 mask 001 010 100 — — --- [001] 000 [100]

6 [110] i=6.
i 110 110 110 mask 001 010 100 — — --- 000 [010] [100]

7 [111] i=7.
i 111 111 111 mask 001 010 100 — — --- [001] [010] [100]

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it