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.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main{ | |
| public static void main(String[] args){ | |
| String[] 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // Your code here | |
| Scanner sc = new Scanner(System.in); | |
| int t = 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // 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
| import java.io.*; // for handling input/output | |
| import java.util.*; // contains Collections framework | |
| import java.util.Map.Entry; | |
| // don't change the name of this class | |
| // you can add inner classes if needed | |
| class Main { | |
| public static void main (String[] args) { | |
| // Your code here | |
| Scanner sc = new Scanner(System.in); | |
| String s = sc.next(); |
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
| function makeCar(name, wheelCount) { | |
| const car = { | |
| name: name, | |
| type: "Car", | |
| wheelCount:wheelCount , | |
| __proto__:vehicle | |
| } | |
| return car; |
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
| Array.prototype.contains = function(val){ return this.some(string =>JSON.stringify(string) === JSON.stringify(val));} | |
| Array.prototype.includesOneof = function(array){ for(let i=0;i<array.length;i++){ if(this.contains(array[i])){ return true; } } return false; } |
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
| // Given an m x n matrix, return all elements of the matrix in spiral order. | |
| // | |
| // Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] | |
| // | |
| // Given an m x n matrix, return all elements of the matrix in spiral order. | |
| // | |
| // Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] | |
| // | |
| // 1 2 3 | |
| // |