setter’s solution is same as yours.
Well, If I write basic differentiation instead of differentiation, will that be better? @jagreetdg
You have forgotten to take mod in your last loop.
You took wrong modulo. Also, distinct function is not needed.
Here’s ur corrected solution.
Thanks a lot !
Differentiation is Differentiation, whether its basic or advanced, since calculus wasn’t my cup of tea ever, I’d get scared with even the slightest hint of it
I did not add the remaining 6 to last element, but to element so that that element becomes a[k-1]+1.
After getting 2 3 4 5 6 7 8 9, My solution add 6 to 4, getting sequence 2 3 10 5 6 7 8 9
which will get the required product.
Might have worked if used Logarithms, but here, we need the product, not summation.
Plus, Time complexity will be an issue in this solution.
Differentiation is just required for proof of solution.
It is not required to solve the problem if you get the intuition of solution.
I wonder how do people like you even think of using basic algorithms like binary search. I mean, even though there was no clue that anything needs to be searched, you applied it. Is this result of just lots of practice ???
Binary Search is my favorite
It’s like lifeline XD
Use it anywhere you want to…
It’s from practice…
Check all the algorithms you know for a particular question… if it can be applied or not…
Codeforces ? smit_mandavia
Bro,you should write a few blogs on cp-topics so newbies like me and Harsh can get help
+you explain stuff very nicely, I’ve seen that at many places
You and beginner ? That was a nice joke !! XD
These rating-stuff is not always accurate… don’t trust those 5-stars, I know that I’m a noob from inside, and 5-star from outside
I’ve started in August…After 3 months, it will be 1 year since I started, then I can call myself, intermediate
Same here then !! I am also noob from inside