From 1c048d22de9f7bd0ef825a0ca51bfec0f3b63a29 Mon Sep 17 00:00:00 2001 From: Arminder Singh Date: 2022年6月17日 00:00:08 +0530 Subject: [PATCH] =?UTF-8?q?Update=20=E2=9C=85=20=20Pattern=2002:=20Two=20P?= =?UTF-8?q?ointers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing Minor Mistake in 2nd Example in Remove Element Question. --- "342円234円205円 Pattern 02: Two Pointers.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/342円234円205円 Pattern 02: Two Pointers.md" "b/342円234円205円 Pattern 02: Two Pointers.md" index a2484e8..97c0ced 100644 --- "a/342円234円205円 Pattern 02: Two Pointers.md" +++ "b/342円234円205円 Pattern 02: Two Pointers.md" @@ -158,7 +158,7 @@ function removeElement(arr, key) { } removeElement([3, 2, 3, 6, 3, 10, 9, 3], 3)//4, The first four elements after removing every 'Key' will be [2, 6, 10, 9]. -removeElement([2, 11, 2, 2, 1], 2)//2, The first four elements after removing every 'Key' will be [2, 6, 10, 9]. +removeElement([2, 11, 2, 2, 1], 2)//2, The first two elements after removing every 'Key' will be [11, 1]. ```` - The time complexity of the above algorithm will be `O(N)`, where `N` is the total number of elements in the given array. - The algorithm runs in constant space `O(1)`.

AltStyle によって変換されたページ (->オリジナル) /