Skip to content

Commit

Permalink
Added test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiujjawal22 committed May 29, 2020
1 parent c0eb73a commit 3b52109
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Others/3 sum.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
*
* @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.
*
*
*/


Expand All @@ -26,7 +38,7 @@ public static void main(String args[])
{
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
Expand Down
21 changes: 21 additions & 0 deletions Others/Rotation of array without using extra space.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
*
* @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{
Expand Down

0 comments on commit 3b52109

Please sign in to comment.