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.List; | |
| import java.util.stream.Collectors; | |
| class Scratch { | |
| public static void countVowelAndConsonant(String s) { | |
| String VOWELS = "aeiouy"; | |
| String normalized = s.toLowerCase().trim(); | |
| List<Integer> letters = normalized.chars() |
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.Arrays; | |
| class Scratch { | |
| public static int maxProduct(int[] numbers) { | |
| int length = numbers.length; | |
| if (length < 2) { | |
| throw new IllegalArgumentException(String.format("Require at least 2 numbers. But given: %s", Arrays.toString(numbers))); | |
| } | |
| int min1 = numbers[0]; |
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
| fn main() { | |
| let mut v = vec![1, 2, 3, 4, 5]; | |
| let exp = 2; | |
| for num in &mut v { | |
| *num = i32::pow(*num, exp); | |
| } | |
| println!("{:?}", v); | |
| } |
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
| {"measurement": {"sepal_length": 5.1, "sepal_width": 3.5, "petal_length": 1.4, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 4.9, "sepal_width": 3.0, "petal_length": 1.4, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 4.7, "sepal_width": 3.2, "petal_length": 1.3, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 4.6, "sepal_width": 3.1, "petal_length": 1.5, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 5.0, "sepal_width": 3.6, "petal_length": 1.4, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 5.4, "sepal_width": 3.9, "petal_length": 1.7, "petal_width": 0.4}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 4.6, "sepal_width": 3.4, "petal_length": 1.4, "petal_width": 0.3}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 5.0, "sepal_width": 3.4, "petal_length": 1.5, "petal_width": 0.2}, "species": "setosa"} | |
| {"measurement": {"sepal_length": 4.4, "sepal_width": 2.9 |
OlderNewer