Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F646233
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, May 11, 1:14 PM (1 d, 15 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d3/6b/1c5dd9473e8805a36b5ba878b236
Attached To
rGFS Google foobar
Event Timeline
Log In to Comment