We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9415f45 commit 541238cCopy full SHA for 541238c
Solutions/TwoSum/C/README.md
@@ -1,7 +1,7 @@
1
-## My approach
+## Approach
2
- A custom struct Number is used to store both the value and original index of each number from the input array.
3
- The array is then sorted using bubble sort based on the values.
4
- A two-pointer technique is applied:
5
- One pointer starts at the beginning (left), and one at the end (right) of the sorted array.
6
- The loop moves the pointers inward until a pair is found such that value[left] + value[right] == target.
7
-- The original indices of the two numbers that sum up to the target are stored in a dynamically allocated result array and returned.
+- The original indices of the two numbers that sum up to the target are stored in a dynamically allocated result array and returned.
0 commit comments