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...
-
19:33
DeVory Darkins
18 hours ago $10.20 earnedBREAKING: Charlie Kirk's shooter in custody after making chilling confession
39.1K147 -
2:12:43
TimcastIRL
11 hours agoErika Kirk Addresses Public After Charlie Kirk Assassination, Live Coverage | Timcast IRL
426K416 -
30:59
The Charlie Kirk Show
11 hours agoCharlie Kirk's beloved wife, Mrs. Erika Kirk addresses the Nation.
567K1.66K -
1:53:28
Man in America
19 hours agoLIVE: Assassin Arrested? Civil War? Are We Being Played?? | LET'S TALK
114K158 -
2:10:33
Badlands Media
16 hours agoOnlyLands Ep. 24: Processing Tragedy, Cancel Culture, and the Next Spark
77.4K30 -
2:27:53
TheSaltyCracker
12 hours agoGot Him ReeEEStream 9-12-25
296K406 -
52:11
Sarah Westall
13 hours agoBread and Circus Keeps you Financially Ignorant – Its Better for the Elites w/ Chris Russo
81.3K8 -
3:49:08
I_Came_With_Fire_Podcast
20 hours agoFriday Night Live Fire
72.1K7 -
1:20:39
Flyover Conservatives
22 hours agoFrom Demonic Deception to Divine Direction: Sid Roth’s Radical Encounter With God | FOC Show
75K1 -
2:50:58
Chrissie Mayr
10 hours agoChrissie Mayr Reactions to Charlie Kirk, Liberal Celebrations, and More
64.1K43