+ 2
How to find set of (a,b,c) such that: a*b*c = d, with d is input parameters and a#b#c. (JAVA)
Test Case: input 12 Output 1,2,6 and 1,3,4 When I run my code, the output is 1,2,6 2,6,1 ..., 1,3,4 1,4,3. How can I print only two sets 1,2,6 and 1,3,4 https://code.sololearn.com/cMh2mefZTnN1/?ref=app
4 Respuestas
+ 2
in loops, start from b=a, and c = b ( skip already checked one)..
Then while printing a, b, c are distinct.
+ 2
I did it. Thank you so much!!
+ 1
You're welcome..
0
Hay