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.*; | |
| import java.util.*; // insert this line too | |
| class SolutionClass { | |
| public static void main(String[] args) throws java.lang.Exception { | |
| // copy from here | |
| Scanner sc = new Scanner(System.in); | |
| int n = sc.nextInt(); | |
| int count = 0; | |
| while (n != 1) { |
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 tensorflow as tf | |
| import keras_preprocessing | |
| from keras_preprocessing import image | |
| from keras_preprocessing.image import ImageDataGenerator | |
| TRAINING_DIR = "/content/drive/MyDrive/Colab Notebooks/Training" | |
| training_datagen = ImageDataGenerator( | |
| rescale=1.0 / 255, | |
| horizontal_flip=True, | |
| rotation_range=30, |
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 LargestRectangleArea { | |
| public static void main(String[] args) { | |
| int[] heights = { 2, 1, 5, 6, 2, 3 }; | |
| System.out.println(largestRectangleArea(heights)); | |
| } | |
| static int largestRectangleArea(int[] heights) { |
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
| package questions; | |
| import java.util.*; | |
| public class StockSpan { | |
| public static void main(String[] args) { | |
| int[] nums = { 100, 80, 60, 70, 60, 75, 85 }; | |
| // int[] nums = { 100 }; | |
| List<Integer> ans = new ArrayList<>(); | |
| getStockSpan(ans, new Stack<>(), nums); |
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
| package questions; | |
| import java.util.*; | |
| public class NearestSmallerToRight { | |
| public static void main(String[] args) { | |
| // int[] nums = { 4, 5, 2, 10, 8 }; | |
| // int[] nums = { 5, 4, 3, 2, 1 }; | |
| // int[] nums = { 1, 2, 3, 4, 5 }; | |
| int[] nums = { 10, 9, 11, 8, 13, 15, 6 }; |
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
| package questions; | |
| import java.util.*; | |
| public class NearestSmallerToLeft { | |
| public static void main(String[] args) { | |
| // int[] nums = { 4, 5, 2, 10, 8 }; | |
| // int[] nums = { 5, 4, 3, 2, 1 }; | |
| int[] nums = { 1, 2, 3, 4, 5 }; | |
| List<Integer> ans = new ArrayList<>(); |
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
| # String variables | |
| myself: Ashutosh Dhande | |
| fruit: "apple" | |
| job: 'swe' | |
| bio: | | |
| hey my name is Ashutosh Dhande. | |
| Wanna be SWE. | |
| # write a single line in multiple lines |
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
| # To differentiate between documents we use --- and to end the document we use ... after this we dont add anything | |
| #Key value pairs or KEY DATATYPE | |
| "Ashutosh": "This is my name" | |
| 9658: "License Plate number" | |
| --- | |
| #List data type | |
| - VLSI | |
| - EME | |
| - ML |
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
| package questions; | |
| import java.util.*; | |
| public class NearestGreaterToLeft { | |
| public static void main(String[] args) { | |
| // int[] nums = { 1, 3, 2, 4 }; | |
| int[] nums = { 6, 5, 1, 2, 3 }; | |
| List<Integer> ans = new ArrayList<>(); | |
| Stack<Integer> stack = new 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 NearestGreaterToRight { | |
| public static void main(String[] args) { | |
| int[] nums = { 1, 3, 2, 4 }; | |
| List<Integer> ans = new ArrayList<>(); | |
| Stack<Integer> stack = new Stack<>(); | |
| getNextGreater(ans, stack, nums); | |
| Object[] solution; | |
| solution = ans.toArray(); |
NewerOlder