Added test cases

This commit is contained in:
joshiujjawal22 2020-05-29 12:32:24 +05:30
parent c0eb73aff0
commit 3b52109fc0
2 changed files with 34 additions and 1 deletions

View File

@ -11,6 +11,18 @@ import java.util.Arrays;
*
* @author Ujjawal Joshi
* @date 2020.05.18
*
* Test Cases:
Input:
* 6 //Length of array
12 3 4 1 6 9
target=24
* Output:3 9 12
* Explanation: There is a triplet (12, 3 and 9) present
in the array whose sum is 24.
*
*
*/
@ -26,7 +38,7 @@ class threesum{
{
a[i]=sc.nextInt();
}
System.out.println("Number to be find");
System.out.println("Target");
int n_find=sc.nextInt();
Arrays.sort(a); // Sort the array if array is not sorted

View File

@ -8,6 +8,27 @@ import java.util.*;
*
* @author Ujjawal Joshi
* @date 2020.05.18
*
* Test Cases:
Input:
2 //Size of matrix
1 2
3 4
Output:
3 1
4 2
------------------------------
Input:
3 //Size of matrix
1 2 3
4 5 6
7 8 9
Output:
7 4 1
8 5 2
9 6 3
*
*/
class main{