Skip to content

Commit 3b52109

Browse files
Added test cases
1 parent c0eb73a commit 3b52109

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Others/3 sum.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
*
1212
* @author Ujjawal Joshi
1313
* @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+
1426
*/
1527

1628

@@ -26,7 +38,7 @@ public static void main(String args[])
2638
{
2739
a[i]=sc.nextInt();
2840
}
29-
System.out.println("Number to be find");
41+
System.out.println("Target");
3042
int n_find=sc.nextInt();
3143

3244
Arrays.sort(a); // Sort the array if array is not sorted

Others/Rotation of array without using extra space.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@
88
*
99
* @author Ujjawal Joshi
1010
* @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+
*
1132
*/
1233

1334
class main{

0 commit comments

Comments
 (0)