setter’s solution is same as yours.


@jagreetdg xDDDD

@yadnesh_viper Yeah… just saw it


Well, If I write basic differentiation instead of differentiation, will that be better? :stuck_out_tongue: @jagreetdg


You have forgotten to take mod in your last loop.




@sikander_nsit thanks. can’t believe myself :stuck_out_tongue:


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 :stuck_out_tongue:


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.


Thank you!


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.


WOW !!!
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 :slight_smile:
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 :slight_smile:


Bro,you should write a few blogs on cp-topics so newbies like me and Harsh can get help :slight_smile:
+you explain stuff very nicely, I’ve seen that at many places :slight_smile: :slight_smile:


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 :stuck_out_tongue:

I’ve started in August…After 3 months, it will be 1 year since I started, then I can call myself, intermediate :slight_smile:


Same here then !! I am also noob from inside :stuck_out_tongue: