|
0
devil was right |
|
0
Maybe you have checked only a specific case in your second for loop. It will be better if you try to make the original string from the answer and then compare. |
|
+19
Problem D looked like a standard interview problem. |
|
0
Solution for C: Initialize a string str of 1's of same size. In C just put 0 on both side of string str at x distance, if you get 0 at a position in input string. For -1 condition : Check if you can form input string from the string str according to given rules. If you can't form input string print -1. |
|
0
One of the most stable and decent question sets. |
|
0
nice try |
|
0
I feel problem C was easy ,but it's framing was not proper. |
|
0
got it. |
|
0
Hey @adedalic I have one doubt in D, You have said, EDIT: |
|
0
this mistake cost me 2 WAs but finally caught it by testing new samples. |
|
0
There is a constructor in struct declaration ( Node(int x) {.....} ) , when you create a node you need to pass a value such this constructor function gets initialized. Read about constructors online. Learn about default and parameterized constructors. |
|
0
Okay, okay I understood now, Even if $$$a_{i+1}$$$ and $$$a_{1+2}$$$ are adjacent, in the next step I will either lose the container in which $$$a_{i+1}$$$ is added or the container in which $$$a_{i+2}$$$ is added, because the containers will be adjacent. If the containers don't get deleted till the end, then $$$a_{i+1}$$$ and $$$a_{1+2}$$$ will be the only adjacent elements in our answer !!! .` |
|
0
Consider ... $$$a_{i-1}$$$,$$$a_{i}$$$,$$$a_{i+1}$$$,$$$a_{i+2}$$$,$$$a_{i+3}$$$ ,$$$a_{i+4}$$$.... If I remove $$$a_{i}$$$ and $$$a_{i+3}$$$, then this would add $$$a_{i-1}$$$,$$$a_{i+1}$$$,$$$a_{i+2}$$$ and $$$a_{i+4}$$$ to the answer. Here $$$a_{i+1}$$$ and $$$a_{i+2}$$$ are adjacent elements and also I am not in my last step. This is confusing !!! |
|
0
$$$a_{i-1}$$$,$$$a_{i}$$$,$$$a_{i+1}$$$,$$$a_{i+2}$$$,$$$a_{i+3}$$$ and $$$a_{i+4}$$$ |
|
0
a_{i+1} |
|
0
Thanks !! |
|
+6
He is |%|e |
|
0
:D |
|
0
I'll climb ladders then. Happy fixing. |
|
0
adedalic why didn't you use ceil() function in problem A. I think I got WA on TC 22 because I used ceil(). My solution 1: link My soln 2 :using_binary_search Both give WA in TC 22. |