SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Substring concatenation CPP Solution #474

Closed sarthakvijay closed 2 years ago

sarthakvijay commented 2 years ago

Choose your form and fill it -

1. Form 1(C++ Solution contributors)

2. Form 2(C++ Documentation Contributors)


1) Form 1

Issue Id you have worked upon -

468

Briefly explain your program logic -

- Create a map for all the string in list of string array with count/frequency
- No start iterating strings with L(length of each string) as the addition in each 
- Maintain the count of string appread in the substring from (that start to totallength of big string) 
- for Each iteraration see if both the hashmao match and have same frequncy of word 
- If same add the starting index to result ArrayList

Screenshots(Attach 2 screenshots of your own input and output) -

Custome Example 1

Custom Example 2


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -


2) Form 2

Issue Id you have worked upon -

Kindly write your answer here


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your Pull Request for merging -

SarthakKeshari commented 2 years ago

@sarthakvijay, You can add screenshot directly. I have attached the screenshot below for reference. image

sarthakvijay commented 2 years ago

@SarthakKeshari Okay, Did it. Thanks