Skip to content

Instantly share code, notes, and snippets.

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
## Major bug fix updates produced after the final release of the
## distribution.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
@Kedstar99
Kedstar99 / combination-sum.rs
Created March 17, 2020 22:21
Rust Memoization Combination-sum
use std::collections::HashSet;
use std::collections::HashMap;
impl Solution {
pub fn combination_sum(candidates: Vec<i32>, target: i32) -> Vec<Vec<i32>> {
let min: &i32 = candidates.iter().min().unwrap();
let min: i32 = *min;
let candidates: HashSet<i32> = candidates.into_iter().collect();
let mut cache: HashMap<i32, Vec<Vec<i32>>> = HashMap::new();
Solution::combination_helper(&candidates, target, min, &mut cache);
@Kedstar99
Kedstar99 / SysInfo
Created September 8, 2018 19:49
System Information
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 5 2600 Six-Core Processor
CPU Family: 0x17