Nice to see you back! Always interesting to compare languages. As a side note, for the 2nd C++ solution at 6:22, I would suggest using the std::count_if algorithm (available since C++98), which does the same thing as the proposed solution with std::accumulate, but in a simpler and more expressive way. Since it maps directly to the problem statement, that would be my favorite C++ solution also.
Sir very nice Pls keep uploading such solution videos with brief discussion on core concept as well 😊 Only u r helping struggling competitive coders 🙏🏻
Stupid question , would just taking the log base 10 of the number and if it is odd be sufficient ? Not sure why mapping to strings was needed , good work for presentation, damn good to see , already subscribed 😀
How can we come to know a problem should be solved in either O(n) or O(nlogn) or O(n^2) etc based on given memory and size constraints. Please help me out.
Love that for Python you give the naive version and the Pythonic version. Please keep doing that going forward.
This video is so informative. Thanks so much. Would love to see tons of coding explanations in similar format :)
Nice to see you back! Always interesting to compare languages.
As a side note, for the 2nd C++ solution at 6:22, I would suggest using the std::count_if algorithm (available since C++98), which does the same thing as the proposed solution with std::accumulate, but in a simpler and more expressive way. Since it maps directly to the problem statement, that would be my favorite C++ solution also.
That's a great point. I totally agree - oversight on my part.
Great to see you back! Waiting for your CPP journey video! I have been doing deep learning recently and I hope it can make it to NVidia in future.
Great video as always!
Summing booleans as integers would result in shorter code in python:
sum( len(str(x)) % 2 == 0 for x in nums)
Yep, great point!
Sir very nice
Pls keep uploading such solution videos with brief discussion on core concept as well 😊
Only u r helping struggling competitive coders 🙏🏻
You’ve unlocked the code to my heart
Don't "reduce" me to tears :p
Stupid question , would just taking the log base 10 of the number and if it is odd be sufficient ? Not sure why mapping to strings was needed , good work for presentation, damn good to see , already subscribed 😀
I completely agree with you.
Glad to see you back
Why do you convert to string and then count the length? Wouldn't it be better to take the floor of mod10?
How can we come to know a problem should be solved in either O(n) or O(nlogn) or O(n^2) etc based on given memory and size constraints.
Please help me out.
C#:
input.Select(n => n.ToString().Length).Where(n => n%2==0).Count();
or shorter but slower
input.Select(n => n.ToString().Length).Count(n => n%2==0);
Where APL?
Great work!
Instead of accumulate you could have used transform_reduce where transform is (to_string(e).size()%2 == 0)
I just hope CodeChef skips over C++17 and introduces C++20 :)
I'm getting runtime error
Clojure looks nice.
we miss you
I'll be posting more frequently going forward :)