Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

1346. Check If N and Its Double Exist
8 months ago
9
Given an array arr of integers, check if there exist two indices i and j such that :
i != j
0 <= i, j < arr.length
arr[i] == 2 * arr[j]
Example 1:
Input: arr = [10,2,5,3]
Output: true
Explanation: For i = 0 and j = 2, arr[i] == 10 == 2 * 5 == 2 * arr[j]
Example 2:
Input: arr = [3,1,7,11]
Output: false
Explanation: There is no i and j that satisfy the conditions.
Constraints:
2 <= arr.length <= 500
-103 <= arr[i] <= 103
bool checkIfExist(int* arr, int arrSize) {
int n = arrSize;
for(int i=0; i<n; i++)
for(int j=i+1; j<2*n; j++)
if(arr[i] == 2*arr[j%n] && i != j%n){
printf("%d %d",arr[i],2*arr[j%n]);
return true;
}
return false;
}
Loading comments...
-
2:29:46
FreshandFit
6 hours agoAfter Hours w/ Girls
102K64 -
5:28
Zach Humphries
12 hours ago $0.90 earnedNEAR PROTCOL AND STELLAR TEAM UP!
10.2K2 -
1:09:57
Brandon Gentile
1 day ago10,000 Hour BITCOIN Expert Reveals Why $13.5M Is Just The Start
15.9K2 -
2:03:55
Badlands Media
6 hours agoDevolution Power Hour Ep. 382: DOJ Coverups, Clapper’s Team Sport & Trump’s Countermoves
127K19 -
2:06:30
Inverted World Live
9 hours agoDon't Approach the Zombie Rabbits | Ep. 95
50.4K24 -
3:26:45
Drew Hernandez
5 hours agoISRAEL PLANNING POSSIBLE DRAFT IN USA & TRUMP'S VIEW ON ETERNAL LIFE ANALYZED PT 2
39.2K28 -
3:08:07
TimcastIRL
9 hours agoTexas Republicans Win, House Passes Redistricting Map, GOP Looks To Gain 5 Seats | Timcast IRL
188K76 -
1:30:34
FreshandFit
9 hours agoHow To Stay Focused While Pursuing Women...The Good, The Bad, And The Ugly
63.2K39 -
1:47:05
Drew Hernandez
13 hours agoISRAEL PLANNING POSSIBLE DRAFT IN USA & TRUMP'S VIEW ON ETERNAL LIFE ANALYZED PT 1
45.6K62 -
29:55
Afshin Rattansi's Going Underground
3 days agoProf. Omer Bartov: The REAL REASON the US, UK, and EU Have Not Recognised Israel’s Genocide in Gaza
42.4K29