From ea29c10cf1a6b2bdcaf9319f43c099ff99b5c61d Mon Sep 17 00:00:00 2001 From: SHIVAM KUMAR KASAUDHAN <124242999+shivamkasaudhan@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:35:37 +0530 Subject: [PATCH] Q. NO. 2903 --- Q2903Leetcode.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Q2903Leetcode.cpp diff --git a/Q2903Leetcode.cpp b/Q2903Leetcode.cpp new file mode 100644 index 0000000..ff05470 --- /dev/null +++ b/Q2903Leetcode.cpp @@ -0,0 +1,17 @@ +// 2903. Find Indices With Index and Value Difference I +//tc o(n^2) +//sc O(1) +//code +class Solution { +public: + vector findIndices(vector& nums, int d, int v) { + for(int i =0; i=d && abs(nums[i]-nums[j])>=v){ + return {i,j}; + } + } + } + return {-1,-1}; + } +}; \ No newline at end of file