0
Java (TripleForLoopCode)
is this code run like this?(comment) https://code.sololearn.com/cS2gapxpT4ro
5 Answers
+ 2
Rael I'm just showing you the order how 2 nested the loops run inside an outer loop
if you replace your if statement with the following you can see what's happening
System.out.println(arr1[i]+" "+arr2[x]+" "+arr1[i] +" "+arr3[p]);
+ 3
3 loops like yours runs like this I will call each loop A B C and say it runs 2 times.
A
B
CC
B
CC
Back to Outer Loop
A
B
CC
B
CC
+ 1
ps
your code does 216 loops with if check
if you divide your if expression:
for(int i ..
for(int x ..
if(arr1[i] == arr2[x])
for(int p ..
if(arr1[i] == arr3[p])
System.out ..
then it do 48 loops with same result
+ 1
D_Stark yeah i so same as i comment,thanks a lot!
0
D_Stark what means? đ