This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // public class Solution | |
| // { | |
| // public static TreeNode<Integer> sortedListToBST(Node<Integer> head) | |
| // { | |
| // // Write your code here. | |
| // } | |
| // } | |
| public class Solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /************************************************************ | |
| Following is the TreeNode class structure | |
| class TreeNode<T> { | |
| T val; | |
| TreeNode<T> left; | |
| TreeNode<T> right; | |
| public TreeNode(T val) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // public class Solution { | |
| // public static boolean validStackPermutation(ArrayList<Integer> first, ArrayList<Integer> other){ | |
| // // Write your code here. | |
| // } | |
| // } | |
| import java.util.ArrayList; | |
| import java.util.Stack; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // import java.util.*; | |
| // public class Solution | |
| // { | |
| // static public int findTheWinner(int n, int k) { | |
| // // Write your code here | |
| // } | |
| // } | |
| public class Solution { | |
| static public int findTheWinner(int n, int k) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // public class Solution { | |
| // public static String amazingStrings(string first, string second,string third) { | |
| // // Write your code here. | |
| // } | |
| // } | |
| public class Solution { | |
| public static String amazingStrings(String first, String second, String third) { | |
| // Declaring the size of string 'C' which will be used a lot of time later in code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Pyramid Number Pattern | |
| import java.util.*; | |
| public class Solution { | |
| public static void main(String[] args) { | |
| // Write your code here | |
| Scanner sc = new Scanner(System.in); | |
| int n = sc.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // public class solution { | |
| // public static void makeRowsCols0(int [][]input) { | |
| // // Write your code here | |
| // } | |
| // } | |
| import java.util.Scanner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // public class Solution { | |
| // public static void main(String[] args) { | |
| // /* Your class should be named Solution. | |
| // * Read input as specified in the question. | |
| // * Print output as specified in the question. | |
| // */ | |
| // // Write your code here |