Skip to content
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

Count_Inversion.cpp #2442

Closed
wants to merge 3 commits into from
Closed

Conversation

mansikagrawal
Copy link
Contributor

@mansikagrawal mansikagrawal commented Mar 13, 2020

Fixes #1664

Checklist:

  • 4 space indentation.
  • Coding conventions are followed.
  • Input is taken dynamically.
  • Sample Input / Output is added at the end of file.
  • Logic Documentation (Comments).
  • File names are correct.

Changes proposed in this pull request:

  • Added file Count_Inversion.cpp

Languages Used:

  • CPP

Files Added:

  • Count_Inversion.cpp

@mansikagrawal
Copy link
Contributor Author

@somya-kapoor Mam please check I had created a fresh new commit with the updated file.

int n;
cin >> n;
int arr[n];
for(int i=0; i<n; i++)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add space around the operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space is already present mam.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be for(int i = 0; i < n; i++)

int arr[n];
for(int i=0; i<n; i++)
cin >> arr[i];
cout << (inversions_count(arr, n))<<endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add space around the <<

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space is already present mam

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<endl space is not present in it.

@mansikagrawal
Copy link
Contributor Author

@somya-kapoor Mam please check now

int n;
cin >> n;
int arr[n];
for(int i=0; i < n; i++)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space around = also

@mansikagrawal
Copy link
Contributor Author

@somya-kapoor Please check again mam

@somya-kapoor
Copy link
Collaborator

@mansikagrawal Good work. Looks good to me. Just squash the commits, then it will be ready to merge.

@somya-kapoor
Copy link
Collaborator

@mansikagrawal Are you working on it?

@mansikagrawal
Copy link
Contributor Author

@somya-kapoor Mam I'll squash the commit today
Sorry for being late

@mansikagrawal mansikagrawal mentioned this pull request Mar 25, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Count inversion in c++ and java.
2 participants