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
9 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...
-
20:23
Scammer Payback
7 hours agoTerrifying Scammers with File Deletions
8.4K1 -
16:22
The Gun Collective
4 hours agoWOW! 17 New Guns JUST GOT RELEASED!
6.68K8 -
1:13:57
Glenn Greenwald
5 hours agoYoung Men and Online Radicalization: Dissecting Internet Subcultures with Lee Fang, Katherine Dee, and Evan Barker | SYSTEM UPDATE #516
150K45 -
1:14:57
Sarah Westall
2 hours agoCEO of Crowds on Demand: The Fake World of Social Media, Protests & Movements w/ Adam Swart
27.4K2 -
DVR
Geeks + Gamers
5 hours agoTuesday Night's Main Event
38.6K2 -
40:36
RiftTV
4 hours agoHow We Got 400 Leftists FIRED for MOCKING Charlie Kirk | The Rift | Guest: Olivia Krolczyk
58.5K29 -
DVR
Badlands Media
17 hours agoBadlands Story Hour Ep 134: Godzilla Minus One
16.8K1 -
Patriots With Grit
13 hours agoWrongful Death Without Consequences: Inside the Schara Trial | Scott Schara
15.8K1 -
LIVE
LFA TV
16 hours agoLFA TV ALL DAY STREAM - TUESDAY 9/16/25
505 watching -
LIVE
StevieTLIVE
3 hours agoI'M GONNA BE A DAD!
95 watching