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
1 month 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...
-
LIVE
Man in America
7 hours ago🔴 LIVE: Terror Attacks or False Flags? IT DOESN'T ADD UP!!!
2,072 watching -
1:02:38
Donald Trump Jr.
8 hours agoNew Year’s Terror, Latest Breaking News with Sebastian Gorka | TRIGGERED Ep.204
142K281 -
59:59
The StoneZONE with Roger Stone
4 hours agoAfter Years of Targeting Trump, FBI and DOJ are Unprepared to Stop Terror Attacks | The StoneZONE
27.5K6 -
1:26:42
Leonardaisfunny
2 hours ago $1.09 earnedH-1b Visas: Infinity Indians
15.6K17 -
1:08:33
Josh Pate's College Football Show
7 hours ago $0.40 earnedPlayoff Reaction Special: Ohio State Owns Oregon | Texas Survives | UGA vs Notre Dame Takeaways
18.8K2 -
58:04
Kimberly Guilfoyle
7 hours agoFBI's Terror Response Failures, Live with Steve Friend & Kyle Seraphin | Ep. 185
95.3K37 -
2:15:01
WeAreChange
7 hours agoMassive Developments In Vegas Investigation! UNREAL DETONATION, Shocking Details Emerge!
102K35 -
54:02
LFA TV
14 hours ago2025 Is Off to a Violent Start | TRUMPET DAILY 1.2.25 7pm
39.9K7 -
59:27
theDaily302
13 hours agoThe Daily 302- JJ Carrell
35.9K5 -
2:57
EvenOut
1 day ago $1.66 earnedTHE TELEPORTING PORTA POTTY TWIN RPANK!
35.3K1