-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create anagram_substring_search #159
Open
sayantann11
wants to merge
1
commit into
keshavsingh4522:master
Choose a base branch
from
sayantann11:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anagram substring searching |
your file extension is missing .cpp |
I liked your work so much thanks for approving it I am new to this I will
try to edit and provide the link too..
Can I attach the whole code here I am new to git n facing some issue
β¦On Thu, 22 Oct, 2020, 4:59 pm Keshav Singh, ***@***.***> wrote:
your file extension is missing .cpp
β
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#159 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APOVKHSU7RBYENFLDKI4SHDSMAJRZANCNFSM4S3B3J4Q>
.
|
1. #include<stdio.h>
2. #include<iostream>
3. #include<set>
4. #include<cstring>
5. #include<string>
6. #include<vector>
7. #include<algorithm>
8.
9. using namespace std;
10.
11.
12. bool func(string A, string B);
13. int main()
14. {
15. int i,j,k;
16. int n;
17. cin>>n; //no.of inputs string
18. vector<string>A(n);
19.
20. for(i=0;i<n;i++)
21. {
22. cin>>A[i];
23. }
24.
25.
26. sort(A.begin(),A.end(),func);
27.
28.
29. for(i=0;i<A.size()-1;i++)
30. {
31. string s= A[i+1];
32. int len= A[i].size();
33. for ( j = 0; j < s.size(); j++)
34. { string x=s.substr(j, len);
35.
36. if(x==A[i])
37. {
38. break;
39. }
40. }
41.
42. if(j==s.size())
43. {
44. cout<<"impossible";
45. break;
46. }
47.
48. }
49.
50. for(i=0;i<A.size();i++)
51. {
52. cout<<A[i]<<"\t";
53. }
54. }
55.
56. bool func(string A, string B)
57. {
58. return A.size()<B.size();
59. }
β¦On Thu, Oct 22, 2020 at 4:59 PM Keshav Singh ***@***.***> wrote:
your file extension is missing .cpp
β
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#159 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APOVKHSU7RBYENFLDKI4SHDSMAJRZANCNFSM4S3B3J4Q>
.
|
i have labelled your pull request so it is accpetable in hacktoberfest. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
Add Link of GitHub Profile