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
| use std::{ | |
| cmp::Ordering, | |
| collections::{BinaryHeap, HashMap, HashSet}, | |
| fs::read_to_string, | |
| }; | |
| #[derive(Clone, Debug)] | |
| struct Vertex { | |
| row: usize, | |
| column: usize, |
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
| use std::collections::HashMap; | |
| static DATA: &str = "3,5,1,2,5,4,1,5,1,2,5,5,1,3,1,5,1,3,2,1,5,1,1,1,2,3,1,3,1,2,1,1,5,1,5,4,5,5,3,3,1,5,1,1,5,5,1,3,5,5,3,2,2,4,1,5,3,4,2,5,4,1,2,2,5,1,1,2,4,4,1,3,1,3,1,1,2,2,1,1,5,1,1,4,4,5,5,1,2,1,4,1,1,4,4,3,4,2,2,3,3,2,1,3,3,2,1,1,1,2,1,4,2,2,1,5,5,3,4,5,5,2,5,2,2,5,3,3,1,2,4,2,1,5,1,1,2,3,5,5,1,1,5,5,1,4,5,3,5,2,3,2,4,3,1,4,2,5,1,3,2,1,1,3,4,2,1,1,1,1,2,1,4,3,1,3,1,2,4,1,2,4,3,2,3,5,5,3,3,1,2,3,4,5,2,4,5,1,1,1,4,5,3,5,3,5,1,1,5,1,5,3,1,2,3,4,1,1,4,1,2,4,1,5,4,1,5,4,2,1,5,2,1,3,5,5,4,5,5,1,1,4,1,2,3,5,3,3,1,1,1,4,3,1,1,4,1,5,3,5,1,4,2,5,1,1,4,4,4,2,5,1,2,5,2,1,3,1,5,1,2,1,1,5,2,4,2,1,3,5,5,4,1,1,1,5,5,2,1,1"; | |
| fn main() { | |
| let input: Vec<i8> = DATA.split(",").map(|x| x.parse::<i8>().unwrap()).collect(); | |
| let mut fish_per_day_map: HashMap<i8, i64> = HashMap::new(); | |
| for day in input { | |
| *fish_per_day_map.entry(day).or_insert(0) += 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 json | |
| from urllib.request import urlopen | |
| response = urlopen('https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/1HD1BX5158Y047710?format=json') | |
| responseData = response.read(); | |
| json = json.loads(responseData) | |
| data = list(filter(lambda r: r['VariableId'] == 26 or r['VariableId'] == 28 or r['VariableId'] == 29, json['Results'])) | |
| print(data) |
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
| <scheme name="Darcula - Modified” version="142" parent_scheme="Darcula"> | |
| <metaInfo> | |
| <property name="created">2017-02-21T17:36:45</property> | |
| <property name="ide">idea</property> | |
| <property name="ideVersion">2016.3.4.0.0</property> | |
| <property name="modified">2017-02-21T17:40:08</property> | |
| <property name="originalScheme">_@user_Darcula</property> | |
| </metaInfo> | |
| <option name="LINE_SPACING" value="1.2" /> | |
| <option name="EDITOR_FONT_SIZE" value="12" /> |