From c3aa56749cac0eb607271a7e280f0fa7cf39db8b Mon Sep 17 00:00:00 2001 From: eliphosif <48781875+eliphosif@users.noreply.github.com> Date: Sun, 8 Jun 2025 15:32:24 +0530 Subject: [PATCH 1/3] docs: correct inline conditional syntax in intersection-of-two-linked-lists.md docs: correct inline conditional syntax in getIntersectionNode function Previously, the function attempted to use inline `if` expressions, which are not valid in Go. This change replaces them with proper `if` statements, ensuring correct pointer traversal in finding the intersection node of two linked lists. --- go/intersection-of-two-linked-lists.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/go/intersection-of-two-linked-lists.md b/go/intersection-of-two-linked-lists.md index 7d6b4d6..15886b9 100644 --- a/go/intersection-of-two-linked-lists.md +++ b/go/intersection-of-two-linked-lists.md @@ -92,8 +92,17 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode { // Both pointers move through both lists for a != b { // When reaching the end of a list, switch to the head of the other list - a = if a == nil { headB } else { a.Next } - b = if b == nil { headA } else { b.Next } + if a == nil { + a = headB + } else { + a = a.Next + } + + if b == nil { + b = headA + } else { + b = b.Next + } } return a // or b, both are the intersection node or nil if no intersection From baebd18551a3107a768f20a439f4b4f915b89b2d Mon Sep 17 00:00:00 2001 From: Ashish Pratap Singh Date: Wed, 2 Jul 2025 11:45:02 +0530 Subject: [PATCH 2/3] add .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5226356 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.py +*.json +*.csv \ No newline at end of file From 3331c34a4975a635489d5029535eaba453ff4643 Mon Sep 17 00:00:00 2001 From: Ashish Pratap Singh Date: Wed, 2 Jul 2025 11:48:02 +0530 Subject: [PATCH 3/3] Update min-cost-climbing-stairs.md --- python/min-cost-climbing-stairs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/min-cost-climbing-stairs.md b/python/min-cost-climbing-stairs.md index 48563d8..40380ad 100644 --- a/python/min-cost-climbing-stairs.md +++ b/python/min-cost-climbing-stairs.md @@ -73,7 +73,7 @@ Using dynamic programming, we fill an array with the minimum costs from the base ```python def minCostClimbingStairs(cost): n = len(cost) - dp = [0] * (n + 1) + dp = [0] * (n + 2) # Start calculating the minimum cost from the top to the base. for i in range(n - 1, -1, -1):