From efcad8f309e7635570e33b0c93f54f55eed98400 Mon Sep 17 00:00:00 2001 From: Ankit Singh Tanwar <98187062+ankit957173@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:58:06 +0530 Subject: [PATCH] Update 3_Solution.sol for index out of bound if index provided should be larger than array length and in require index should be smaller than array length --- section-3/lecture-15/3_Solution.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/section-3/lecture-15/3_Solution.sol b/section-3/lecture-15/3_Solution.sol index 44ed475..b11521c 100644 --- a/section-3/lecture-15/3_Solution.sol +++ b/section-3/lecture-15/3_Solution.sol @@ -24,7 +24,7 @@ contract Solution { // require(_index < arr.length, "index out of bound"); // or // - if (_index < arr.length) { + if (_index > arr.length) { return; } for (uint i = _index; i < arr.length - 1; i++) {