Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F956574
Solution.java
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
687 B
Subscribers
None
Solution.java
View Options
public
class
Solution
{
public
static
int
solution
(
int
[]
l
)
{
int
count
=
0
;
for
(
int
i
=
0
;
i
<
l
.
length
;
i
++)
{
for
(
int
j
=
i
+
1
;
j
<
l
.
length
;
j
++)
{
//since index i < j search onwards for the second number
if
(
l
[
j
]
%
l
[
i
]
==
0
)
{
//if second number is divisible move on the finding the third
for
(
int
k
=
j
+
1
;
k
<
l
.
length
;
k
++)
{
//same logic as loop above for the third number
if
(
l
[
k
]
%
l
[
j
]
==
0
)
count
++;
//found a tuple since third is divisible by second
}
}
}
}
return
count
;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 28, 8:05 PM (19 h, 4 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
11/72/3da6468a74d6955576de2370a842
Attached To
rGFS Google foobar
Event Timeline
Log In to Comment