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...
-
2:28:32
MattMorseTV
5 hours ago $28.03 earned🔴Revealing his TRUE MOTIVES.🔴
50.7K158 -
1:18:02
iCkEdMeL
4 hours ago $13.42 earnedBOMBSHELL: Shooter’s Trans Partner Helped Take Him Down
29.2K58 -
1:42:45
The Big Migâ„¢
9 hours agoThe Islamic Invasion – The EU Has Fallen, A Warning For The USA |EP653
40K48 -
LIVE
Joker Effect
4 hours agoRUMBLE IN THE DEN 4 - Hungry fighters and NFL legend fight for respect
564 watching -
44:37
Rebel News
5 hours ago🔴 LIVE NOW: Massive ‘Unite the Kingdom’ Rally in London ft. Tommy Robinson | UKrebels.com
47.3K47 -
17:22
Professor Nez
4 hours ago💣BOMBSHELL: The Biden AutoPen Scandal JUST GOT REAL!
32.7K24 -
2:20:03
I_Came_With_Fire_Podcast
13 hours agoRevelations from the Ukrainian Front Lines
54K14 -
52:56
X22 Report
9 hours agoMr & Mrs X - Big Pharma Vaccine/Drug Agenda Is Being Exposed To The People - Ep 7
114K66 -
1:41:59
THE Bitcoin Podcast with Walker America
14 hours ago $20.01 earnedThe Assassination of Charlie Kirk | Walker America, American Hodl, Erik Cason, Guy Swann
84.4K52 -
21:33
marcushouse
8 hours ago $1.92 earnedSpaceX Just Revealed the Plan for Starship Flight 11! 🚀
39.3K9