Thanks Branyine,
your idea works!
I missed a simple trick of "extending" the base of binary system with -1 :)
With this and continuation the process until both numbers doesn't have both
0s in the middle I managed to code and got all 3 PASS. Unfortunately in
"Practice mode", but still happy.
Yeah there is a constraint of 40 seconds per test set.
I too spent hours figuring it out. If you check the analysis section it
mentions the algo. can be made to run in O (R x C) time.
If u can incorporate those 2 optimisations you should be able to reduce the
execution time.
On Friday, 24
Great! it worked, it is given that there would be atmost 10^4 steps that's
why i used (int). Thanks for making time to debug it. I appreciate it.
On Saturday, April 25, 2020 at 1:16:00 AM UTC+5:30, porker2008 wrote:
>
> You need to use long long to handle intermediate result, otherwise it will
Hi Manav,
U can post your question in the main forum as solo post in increase its
reach.
On Friday, 24 April 2020 02:19:55 UTC+5:30, MANAV KUMAR wrote:
>
> Hello Everyone,
> I am Manav Kumar 3rd year undergrad.
> I am new to this group. I was just practicing previous years problem and
> got
Your solution has time complexity O(N^2) for each query which is too slow
to pass Test set 2
In order to pass test set 2, you need to calculate the number of A to Z in
a given prefix.
Then use this prefix to calculate the number of A to Z in any given range
Then for any given range, check if at
Hey jawa,
You need to process all activities based on the start time.
If you greedily assign activity in the given order, you will fail the
following input
Sample Input
*1*
*4*
*1 2*
*1 5*
*5 6*
*2 6*
Expected output:
*Case #1: CJJC*
However, your solution answers *IMPOSSIBLE*
--
You