File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ Debug: Mergesort
33
44Question:
55
6- Add at most TWO lines of code to make the given broken mergesort
7- function work properly.
6+ Add at most TWO lines of code to make the given buggy mergesort function
7+ work properly.
88
99Hint:
1010Focus on the merge function.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Question:
55
66The given function finds the greatest sum amongst all pairs of elements
77in the array. Optimize this function so that it works on any 5-element
8- list list by executing less than 20 instructions.
8+ list by executing less than 20 instructions.
99
1010Hint:
1111Think about sorting.
Original file line number Diff line number Diff line change 22Remove duplicate characters
33
44Question:
5+
56Write a function to return a new string that contains the contents of
6- the input string with all duplicates removed.
7+ the input string (in the original order) with all duplicate characters
8+ removed.
79
810Hint:
911Think about using a set to keep track of already-seen characters.
Original file line number Diff line number Diff line change 22Reverse list
33
44Question:
5+
56Write a function to return the reverse of the input list.
67
78Hint:
Original file line number Diff line number Diff line change 22Two-sum
33
44Question:
5+
56Write a function to return the sum of the two largest elements in the
67given list.
78
You can’t perform that action at this time.
0 commit comments