Project-Euler
Project-Euler copied to clipboard
08 done in cpp
please merge my PR
code taking too long.
But my code Passed all the test cases of Project Eular. can you please tell me in which test case my code taking time?
Well, I may not be able to help you with test case, but using " #include<bits/stdc++.h> " is like saying ' take every headerfile you can take', this way of coding is helpful where coding time matters, hence we compromise time-complexity for coding time. Try using only necessary header files.
okk i get it thanks i will optimize my code
can you review my code?.this time i used only required header files
Well the problem arose with Max and Min, #include <limits.h> You might need this, but even with this code is taking long time, Try to think another way of solving this problem{ i would suggest }.
please review my code
Well, I appreciate your efforts. Let me give some direct Hint.
to be on the same page, here is the problem.
As, you could see the given number is way big than any long long could handle. Hence, we should use char array { String } to store such large value.
And as you would be using such method of storing the numbers, keep the input within the code and avoid asking users for input. { because, some automated checks just check output and not input}.
and Int can't handle such long numbers.