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
10 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...
-
1:02:50
Flyover Conservatives
9 hours agoEric Trump: America’s Most Subpoenaed Man SPEAKS OUT! | FOC Show
20.8K5 -
LIVE
PandaSub2000
1 day agoLIVE 10/3 @10pm ET | SUPER MARIO GALAXY 1 & 2 on SWITCH 2
237 watching -
1:26:04
Glenn Greenwald
8 hours agoJournalist Ken Klippenstein on Trump's New Domestic Terrorism Memo; Glenn Takes Your Questions on Bari Weiss's CBS Role, His Interview with Nick Fuentes, and More | SYSTEM UPDATE #526
75.8K56 -
SynthTrax & DJ Cheezus Livestreams
2 days agoFriday Night Synthwave 80s 90s Electronica and more DJ MIX Livestream GOTH NIGHT Special Edition
27.1K2 -
2:20:47
Mally_Mouse
5 days agoFriend Friday!! 🎉 - Let's Play! - Lockdown Protocol
29.5K1 -
LIVE
MissesMaam
4 hours ago*Spicy* Friend Friday LOCKDOWN Protocol!!! :: SpookTober 💚✨
199 watching -
41:36
MattMorseTV
5 hours ago $0.80 earned🔴Portland just made a BIG MISTAKE.🔴
43.6K73 -
13:10:23
LFA TV
1 day agoLIVE & BREAKING NEWS! | FRIDAY 10/3/25
165K46 -
4:07:27
Nerdrotic
9 hours ago $0.33 earnedHollywood is TARIFFied, James Gunn Attacks Fans, Bill Burqa, RoP is Doomed | Friday Night Tights 374
76.1K12 -
LIVE
Eternal_Spartan
13 hours ago🟢 Eternal Spartan Plays Destiny 2 | The Best PVP/PVE Action!| USMC Veteran
39 watching