File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 11
11
*
12
12
* @author Ujjawal Joshi
13
13
* @date 2020.05.18
14
+ *
15
+ * Test Cases:
16
+ Input:
17
+ * 6 //Length of array
18
+ 12 3 4 1 6 9
19
+ target=24
20
+ * Output:3 9 12
21
+ * Explanation: There is a triplet (12, 3 and 9) present
22
+ in the array whose sum is 24.
23
+ *
24
+ *
25
+
14
26
*/
15
27
16
28
@@ -26,7 +38,7 @@ public static void main(String args[])
26
38
{
27
39
a [i ]=sc .nextInt ();
28
40
}
29
- System .out .println ("Number to be find " );
41
+ System .out .println ("Target " );
30
42
int n_find =sc .nextInt ();
31
43
32
44
Arrays .sort (a ); // Sort the array if array is not sorted
Original file line number Diff line number Diff line change 8
8
*
9
9
* @author Ujjawal Joshi
10
10
* @date 2020.05.18
11
+ *
12
+ * Test Cases:
13
+
14
+ Input:
15
+ 2 //Size of matrix
16
+ 1 2
17
+ 3 4
18
+ Output:
19
+ 3 1
20
+ 4 2
21
+ ------------------------------
22
+ Input:
23
+ 3 //Size of matrix
24
+ 1 2 3
25
+ 4 5 6
26
+ 7 8 9
27
+ Output:
28
+ 7 4 1
29
+ 8 5 2
30
+ 9 6 3
31
+ *
11
32
*/
12
33
13
34
class main {
You can’t perform that action at this time.
0 commit comments