HackWithInfy 2020 Latest Questions #2 | Aneeq Dholakia | Edyst

preview_player
Показать описание

Presented by: Aneeq Dholakia (IIIT-Hyderabad)
Co-founder | Edyst

Discussion solution for HackWithInfy 2020 questions like:
• Prime Number
• Selection of Kits
• Strong Primes
• Special Set Bits

-------------------------------------------------------------------------------------------------------------------------------------
Sign up for Edyst Course below:

Best Regards,

------------------------- Follow us -------------------------

#HWI #hackwithinfy #hackwithinfy2020 #Edyst #AneeqDholakia
Рекомендации по теме
Комментарии
Автор

In kitten selection we can use max heap to store the numbers while taking I/p from user.

manasvinsharma
Автор

Please update the solution for round 2 practice test...

nagashalini
Автор

given an equation “x=y”, for example, “111=12”, you need to add pluses inside x to make the equation correct. in our example “111=12”, we can add one plus “11+1=12” and the equation becomes correct. you need to find the minimum number of pluses to add to x to make the equation correct. if there is no answer print -1.


Can u solve this

AslamKhan-mszf
Автор

In the kit problem if the ques said to mark the kits that have been selected, for example:
Case 1:

Input:
5
3 4 5 26 7
output:
4 (4th kit has been selected as its strength is 26)
Case 2:
Input:
5
2 4 3 1 6
Output:
3 5 ( 3rd and 5th kit has been selected as their sum is 9 which is greater than 8)
Then how can we do that ??
Also in case 2, the pair can be 6+2, 6+3, 6+4 then how I get those pairs ??

aneeshsrivastava
Автор

Thanks Sir, that bit manipulation helped a lot today!

ratnagaurav
Автор

Is this code is right for selection_kit ques???


arr = list(map(int, input().split()))
arr.sort(reverse = True)
half = sum(arr)//2

current=[]
for i in range(len(arr)):
current.append(arr[i])
if sum(current)>half or (sum(current)>half+1) :
print("number of kit picked by Bob: ", i+1)
break
else:
pass

abhishekjain
Автор

in kits problem why it is necessary to do the half of sum . instead we can sort it in reverse order and put condition if(arrr[0]>sum of other sorted elements) return 1;

pankajdadwal
Автор

Howmany days before they inform for 1st round hackwithinfy.

parassuvagiya
Автор

sir when will be the round1 of hackwithinfy 2020

koluboyinavaraprasad