diff --git a/02. Linked lists/2.2. return_kth_to_last.md b/02. Linked lists/2.2. return_kth_to_last.md index 84a623c..fe56d6f 100644 --- a/02. Linked lists/2.2. return_kth_to_last.md +++ b/02. Linked lists/2.2. return_kth_to_last.md @@ -10,7 +10,7 @@ class Node { int data; public Node(int d){ - data = d; + this.data = d; } void appendToTail(int d){ diff --git a/02. Linked lists/delete_node.java b/02. Linked lists/hackerrank/delete_node.java similarity index 100% rename from 02. Linked lists/delete_node.java rename to 02. Linked lists/hackerrank/delete_node.java diff --git a/02. Linked lists/get_kth_node_value.java b/02. Linked lists/hackerrank/get_kth_node_value.java similarity index 100% rename from 02. Linked lists/get_kth_node_value.java rename to 02. Linked lists/hackerrank/get_kth_node_value.java diff --git a/08. Recursion/8.3. magic_index.md b/08. Recursion/8.3. magic_index.md index dd93896..2943262 100644 --- a/08. Recursion/8.3. magic_index.md +++ b/08. Recursion/8.3. magic_index.md @@ -1,6 +1,6 @@ # 8.3. Magic index -## Given an array of **distinct** integers, find a magix index, ifo ne exists. A magic index in an array A is an index such that A[i] = 1 +## Given an array of **distinct** integers, find a magix index, if one exists. A magic index in an array A is an index such that A[i] = 1 ## First idea diff --git a/16. Moderate problems/16.17. max_subarray.md b/16. Moderate problems/16.17. max_subarray.md index a3b77e5..e50dba3 100644 --- a/16. Moderate problems/16.17. max_subarray.md +++ b/16. Moderate problems/16.17. max_subarray.md @@ -1,8 +1,8 @@ # 16.8. Contiguous sequence or Maximum subarray problem -## Given an array of integers, both negative and positive, find the contiguous sequence with the largest sum. Return the sum +> Given an array of integers, both negative and positive, find the contiguous sequence with the largest sum. Return the sum -> example: +Example: ```bash nums = [2, -8, 3, -2, 4, -10] @@ -101,4 +101,4 @@ We only want negative numbers inculded in the sequence when they are in the midd My code is exactly the same as the solution! (except for some unecessary variables I had). -If all numbers in the array are negative, can we consider a subsequence of length = 0 and thus maxval = 0? or does it need to have 1+ values? this is a good thing to consider with the interviewer. \ No newline at end of file +If all numbers in the array are negative, can we consider a subsequence of length = 0 and thus maxval = 0? or does it need to have 1+ values? this is a good thing to consider with the interviewer.