Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 01 Arrays & Vectors/08 subarray_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ bool outOfOrder(vector<int> arr,int i){
}

pair<int,int> subarraySort(vector<int> arr) {

if(arr.size() == 1) return 0;

Choose a reason for hiding this comment

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

return 0 will give an error I guess here since the return type is pair<int,int>

Copy link
Author

Choose a reason for hiding this comment

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

Yeah! You are right it should return {-1, -1} or (-1, -1) or something invalid pair I think.


int smallest = INT_MAX;
int largest = INT_MIN;
Expand Down