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...
-
1:54:22
vivafrei
4 hours agoOstrich Farm UPDATE! And Live with Tyler Fischer Talking REAL Cancel Culture He is Experiencing!
167K29 -
31:39
Michael Franzese
2 hours agoAmerica’s Human Trafficking Crisis EXPOSED by Former Mobster
29.1K11 -
LIVE
Wayne Allyn Root | WAR Zone
7 hours agoWatch LIVE: The War Zone Podcast with Wayne Allyn Root
54 watching -
DVR
The Liberty Lobbyist
3 hours ago"The View From The Top: How Leadership Shapes Legislation and Responds to Activism"
4.31K -
4:59:50
Barry Cunningham
6 hours agoPRESIDENT TRUMP NEEDS TO STAND FIRM AND SHUT THE GOVERNMENT DOWN IF HE HAS TO!
53.5K38 -
23:45
IsaacButterfield
13 hours ago $1.08 earnedThe Rise of Autism in Gen Z
20.2K12 -
LIVE
LFA TV
1 day agoBREAKING NEWS ALL DAY! | THURSDAY 9/25/25
911 watching -
1:59:20
The Quartering
8 hours agoCharlie Kirk Conspiracies Go TOO FAR, Youtube Re-Bans Everyone & Libs Dying From Tylenol
168K87 -
DVR
The Trish Regan Show
4 hours agoTrump SUES Disney Over Kimmel’s Return to ABC! Disney CEO, Kimmel BOTH OUT!?!
31.8K7 -
1:07:22
Dr. Drew
6 hours agoTargeted: Political Violence Began Long Before Charlie Kirk's Assassination – Leftist Influencers Like Hasan Piker Are Making It Worse w/ Dave Rubin & Jack Posobiec – Ask Dr. Drew
33.4K2