Пікірлер
@rajavignesh7216
@rajavignesh7216 Жыл бұрын
Can u pls share me the source code 😔
@wayofmuhammad
@wayofmuhammad Жыл бұрын
Awsome
@sawankaushal3535
@sawankaushal3535 Жыл бұрын
Wow sir mene ye concept to smj liya tha pr code kese banau smj hi nhi aa raha tha pr ye video dekh kr mujhe bahut kuch smj aaya mene Puri KZbin list Chan li thi or kahi bhi code explain hi nhi kra tha thanku so much sir ❤️
@AMITKUMAR-np7el
@AMITKUMAR-np7el 2 жыл бұрын
can be optimise the code... def knapshak(values,weights,w): ratio=[i/j for i,j in zip(values,weights)] index=list(range(len(values))) index.sort(reverse=True,key=lambda x:ratio[x]) profit=0 for i in index: if w > weights[i]: profit+=values[i] w-=weights[i] else: profit+=w*ratio[i] break return profit values=[100,120,60] weights=[20,30,10] w=50 print(knapshak(values,weights,w))
@liftsbysuku
@liftsbysuku 2 жыл бұрын
Good
@gauravpareek3783
@gauravpareek3783 3 жыл бұрын
Bhai solution doesn't seems correct. If input is like 1 4 4 4 4 4 4 5 and x cost is 2 then it will skip 6 shops continuously but which as per the problem it shouldn't
@jeehacks5129
@jeehacks5129 3 жыл бұрын
Please
@jeehacks5129
@jeehacks5129 3 жыл бұрын
Explain error in it
@tvrao123
@tvrao123 3 жыл бұрын
what do you want me to explain
@jeehacks5129
@jeehacks5129 3 жыл бұрын
@@tvrao123 it's showing run time error
@jeehacks5129
@jeehacks5129 3 жыл бұрын
For most of cases but passed 2 test cases
@tvrao123
@tvrao123 3 жыл бұрын
@@jeehacks5129 can you me test case for which you are getting run time error
@jeehacks5129
@jeehacks5129 3 жыл бұрын
@@tvrao123 they are not shown to us it's a coding contest. For the shown example it's working which is same u explained.
@jeehacks5129
@jeehacks5129 3 жыл бұрын
a=input() a1=a.split() n=int(a1[0]) w=int(a1[1]) b=input() b1=b.split() c=input() c1=c.split() retl=[] for i in range(n): ret1=[] ret1.append(int(b1[i])) ret1.append(int(c1[i])) ret1.append(ret1[0]/ret1[1]) retl.append(ret1) def max(p): flag=len(p) for i in range(flag): for j in range(flag-i-1): if p[j][2]>p[j+1][2]: p[j],p[j+1]=p[j+1],p[j] p.reverse() return p retv=max(retl) sum=i=0 while(w>-1 and i<n): sum=sum+retv[i][0] w-=retv[i][1] i+=1 if w>=0: print("{0:.{1}f}" .format(sum,6)) else: p=w sum=sum+p*retv[i-1][2] print("{0:.{1}f}" .format(sum,6))
@tvrao123
@tvrao123 3 жыл бұрын
Will let you know tomorrow morning
@hanu_106
@hanu_106 3 жыл бұрын
Thanks
@kushagrakunwar175
@kushagrakunwar175 3 жыл бұрын
How to print all the possible way of placing n queens
@tvrao123
@tvrao123 3 жыл бұрын
Is np hard problem
@tvrao123
@tvrao123 3 жыл бұрын
that is not possible, i think
@kushagrakunwar175
@kushagrakunwar175 3 жыл бұрын
@@tvrao123 lol what?😂
@BigBrother4Life
@BigBrother4Life 2 жыл бұрын
@@kushagrakunwar175 I lol too
@varunbhatt7827
@varunbhatt7827 3 жыл бұрын
please give your code link
@chromicle
@chromicle 3 жыл бұрын
can you give the link of the code?
@AdityaSingh-xx8jy
@AdityaSingh-xx8jy 3 жыл бұрын
so easily done..really loved it sir!
@nitishsharma5501
@nitishsharma5501 3 жыл бұрын
wrong ans
@OptimisticForce
@OptimisticForce 3 жыл бұрын
Best Explanation so far. People confused me so much before. Can you make one on TOP DOWN/BOTTOM UP approach as well
@fareedsk6955
@fareedsk6955 3 жыл бұрын
Improve voice quality sir
@tvrao123
@tvrao123 3 жыл бұрын
ok Thank you
@prakash2244
@prakash2244 3 жыл бұрын
Any way tq sir
@prakash2244
@prakash2244 3 жыл бұрын
Sir only one problem na
@prakash2244
@prakash2244 3 жыл бұрын
Sir how many hours sir this class
@tvrao123
@tvrao123 3 жыл бұрын
Will add 2 to 3 problems with solutions per day Call me, for exclusive classes, if intetested
@prakash2244
@prakash2244 3 жыл бұрын
@@tvrao123 s sir
@tvrao123
@tvrao123 3 жыл бұрын
yes - 98663 99916
@tvrao123
@tvrao123 3 жыл бұрын
Feedback please Will post more with more complexity to help students preparing for CAT and GATE
@animeshroychoudhury4293
@animeshroychoudhury4293 3 жыл бұрын
I think is_safe function is wrong. Second while loop is wrong.
@tvrao123
@tvrao123 3 жыл бұрын
it s not wrong at all, checked for all the cases
@kamalgarg589
@kamalgarg589 4 жыл бұрын
Wrong answer.. where it is mentioned that you have cost in sorted order
@nikithareddyankoor6184
@nikithareddyankoor6184 4 жыл бұрын
Its showing time limit exceed from test case 10 to 29
@thedeathmen2066
@thedeathmen2066 4 жыл бұрын
31 should be the answer
@rohanagrawal8504
@rohanagrawal8504 4 жыл бұрын
the code doesn't work For the test case, 10 2 1 2 3 4 5 6 7 8 9 10 a total of 31 can be achieved 1 + 2 + 2 + 2 + 2 + 6 + 2 + 2 + 2 + 10 = 31 person shops at shop numbers 1, 2, 6, and 10 shops skipped - 3, 4, 5, 7, 8 and 9 Clearly 31 < 37.
@nityasingh8276
@nityasingh8276 4 жыл бұрын
When will be the last if case encounter??
@EduSmartByVinay
@EduSmartByVinay 4 жыл бұрын
Sir are you providing any online training now??
@tvrao123
@tvrao123 4 жыл бұрын
Yes I do
@AshishKumar-xg8dm
@AshishKumar-xg8dm 4 жыл бұрын
Hii... could you please share the questions??
@tvrao123
@tvrao123 4 жыл бұрын
Questions for what ?
@AshishKumar-xg8dm
@AshishKumar-xg8dm 4 жыл бұрын
@@tvrao123 These Hackwithinfy Previous Year Questions..
@tvrao123
@tvrao123 4 жыл бұрын
@@AshishKumar-xg8dm available in public domain - please check, and let me know, if you want videos on any / all of them
@AshishKumar-xg8dm
@AshishKumar-xg8dm 4 жыл бұрын
@@tvrao123 Sorry i didn't get you.. Are you saying to get it from Internet. I have searched it for.. But couldn't get good amount of question.. Some sites are just showing 2-3 questions.. If you Know any please Recommend me..
@mahesh-vi2gp
@mahesh-vi2gp 4 жыл бұрын
Sir,please do some videos on data science
@tvrao123
@tvrao123 4 жыл бұрын
sure
@srikantam4796
@srikantam4796 4 жыл бұрын
Rao ji, content is awesome.If the production is better, you'll have a great journey ahead on KZbin. Thanks for the detailed explanation.
@tvrao123
@tvrao123 4 жыл бұрын
thank you
@khajamohiddien9163
@khajamohiddien9163 4 жыл бұрын
at 9:41 sec the ans should be 33 (1 2 3 4 5) time=(1+2)=3 (3 3 4 5) time=3+(3+3)=3+6=9 (4 5 6) time =9+(4+5)=9+9=18 (6,9) time=18+(6+9)=33 But your code is showing 34. Please make some changes and update the video. Thank you🙂.
@tvrao123
@tvrao123 4 жыл бұрын
will check and get back
@naman_goyal
@naman_goyal 4 жыл бұрын
if(a2[i] < 0) sub = (a1[i] + (2*k)) * a2[i]; if(a2[i] > 0) sub = (a1[i] - (2*k)) * a2[i]; you can simply use these condition
@saurav44sc
@saurav44sc 4 жыл бұрын
Python solution: programmer4all.com/prime-fibonacci/
@saurav44sc
@saurav44sc 4 жыл бұрын
Python solution: programmer4all.com/exchange-digits-solution-using-python/
@bhanubunny7617
@bhanubunny7617 4 жыл бұрын
thanks brooo
@gowthame2001
@gowthame2001 4 жыл бұрын
Nice sir and make more videos
@ezhumalaiezhu5855
@ezhumalaiezhu5855 4 жыл бұрын
Bro this is the formula in problem statement (EMI = loanAmount * monthlyInterestRate / ( 1 - 1 / (1 + monthlyInterestRate)^(numberOfYears * 12)) . But you used different one.. Explain that formula
@anavidlearner5562
@anavidlearner5562 4 жыл бұрын
From NEC ...right?
@jigyasasurana9247
@jigyasasurana9247 4 жыл бұрын
I am getting runtime error
@AshuSingh-us5tp
@AshuSingh-us5tp 4 жыл бұрын
Thanks sir.. Sir more videos on tcs please!!
@sahithikomirishetti3380
@sahithikomirishetti3380 4 жыл бұрын
Sir the explanation of code is good but it will be excellent when you explain the code with complexity
@RaviTejaAkshinthala
@RaviTejaAkshinthala 4 жыл бұрын
It is not working for below test case. abc bcd 10
@sounishnath513
@sounishnath513 4 жыл бұрын
finding you in my youtube, is very much great happened to me <3..... Very happyto learn from you!!
@sounishnath513
@sounishnath513 4 жыл бұрын
vector<int>& go(vector<int> &nums) { int n = nums.size(), nxt = 0 ; for (const int x : nums ) { if (x != 0) nums[nxt] = x, nxt++ ; } for (int i = nxt; nums[i] = 0, i < n; i++) ; return nums ; } Solution in C++ || more simple <3
@sumantobanerjee9116
@sumantobanerjee9116 4 жыл бұрын
👏👏👍
@manojkumarr365
@manojkumarr365 4 жыл бұрын
Sir.. Please give solution for Codevita question ON A CUBE
@tvrao123
@tvrao123 4 жыл бұрын
there is some issue in problem statement, will come back to you soon
@manojkumarr365
@manojkumarr365 4 жыл бұрын
@@tvrao123 thank you sir.. Ur videos are so useful
@prashantht4991
@prashantht4991 4 жыл бұрын
Iam getting runtime error if type this code could u help me plz
@godsgrace7029
@godsgrace7029 4 жыл бұрын
sir pls do a video on this problem when you r free www.hackerearth.com/problem/algorithm/dice-rolls/
@tvrao123
@tvrao123 4 жыл бұрын
will do it, need some time to learn maths needed
@godsgrace7029
@godsgrace7029 4 жыл бұрын
@@tvrao123 k sir
@madhunitesh1567
@madhunitesh1567 4 жыл бұрын
Is this question asked in hackwithinfy 2020
@chetankaushik9398
@chetankaushik9398 4 жыл бұрын
def primes_method1(n): out = list() for num in range(2, n+1): prime = True for i in range(2, num): if (num % i == 0): prime = False if prime: out.append(num) return out list1=primes_method1(123) print(list1) sum=0 count=0 for i in list1: sum+=i if sum in list1: count+=1 count-=1 print(count) my solution is 10 times better than yours
@varunkedia6729
@varunkedia6729 4 жыл бұрын
No it is 100 times worse, because it's complexity is O(n^2)