sansyrox / algorithm-ds

MIT License
8 stars 18 forks source link

Added problem solution of Short Substrings Codeforces #20

Closed ayush179 closed 4 years ago

ayush179 commented 4 years ago

The problem is a very popular one where we are dealing with 2 substrings a & b-

b is built from a as follows: write all the substrings of length 2 of the string a in the order from left to right, and then join them in the same order into the string b.

For example, if we come up with the string a="abac", then all the substrings of length 2 of the string a are: "ab", "ba", "ac". Therefore, the string b="abbaac".

Now, what the code does? We are given the string b and we have to find the parent string a. It can work on any number of test cases t. Given below are some test cases. INPUT- 4 abbaac ac bccddaaf zzzzzzzzzz OUTPUT- abac ac bcdaf zzzzzz

sansyrox commented 4 years ago

@ayush179 , this looks really good. Can you add some comments on the top of the file denoting its purpose?

ayush179 commented 4 years ago

Yes sure Thanks

On Sat, Oct 3, 2020, 5:00 PM Sanskar Jethi notifications@github.com wrote:

@ayush179 https://github.com/ayush179 , this looks really good. Can you add some comments on the top of the file denoting its purpose?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sansyrox/algorithm-ds/pull/20#issuecomment-703088882, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOGQ2UNELYN2DHOZ6TFAW5TSI4DM5ANCNFSM4SA4TH7A .

ayush179 commented 4 years ago

@sansyrox , have a look and let me know if any changes are to be made?

ayush179 commented 4 years ago

hey @sansyrox can you add hactoberfest-accepted label to this contribution as per the updated rules of hactober or it may be declared insignificant? Thanks

sansyrox commented 4 years ago

Done @ayush179