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
    
  
  
    
  | /* | |
| If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
| Find the sum of all the multiples of 3 or 5 below 1000. | |
| */ | |
| import Foundation | 
  
    
      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
    
  
  
    
  | /* | |
| Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: | |
| 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | |
| By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. | |
| */ | 
  
    
      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
    
  
  
    
  | /* | |
| The prime factors of 13195 are 5, 7, 13 and 29. | |
| What is the largest prime factor of the number 600851475143 ? | |
| */ | |
| import Foundation | 
  
    
      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
    
  
  
    
  | #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define TOTAL_LETTERS 26 | |
| #define KEY 13 | |
| char rotc(char ch, int key) { | |
| if (ch >= 'A' && ch <= 'Z') { | |
| return 'A' + ((ch - 'A' + key) % TOTAL_LETTERS); | 
  
    
      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::{error::Error, env::args, fs::File, io::Read}; | |
| fn load_input(path : &str) -> Result<Vec<i64>, std::io::Error> { | |
| let mut file = File::open(path)?; | |
| let mut data = String::new(); | |
| file.read_to_string(&mut data)?; | |
| let data : Vec<i64> = data.split('\n') | |
| .map(|line| line.parse::<i64>().unwrap_or(0)).collect(); | 
  
    
      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::{error::Error, env::args, fs::File, io::Read}; | |
| fn load_input(path : &str) -> Result<Vec<i64>, std::io::Error> { | |
| let mut file = File::open(path)?; | |
| let mut data = String::new(); | |
| file.read_to_string(&mut data)?; | |
| let data : Vec<i64> = data.split('\n') | |
| .map(|line| line.parse::<i64>().unwrap_or(0)).collect(); | 
  
    
      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::{env::args, error::Error, fs::File, ops::RangeInclusive, io::Read}; | |
| type PasswordPolicy = (RangeInclusive<u32>, char, String); | |
| fn load_input(path : &str) -> Result<Vec<PasswordPolicy>, std::io::Error> { | |
| let mut file = File::open(path)?; | |
| let mut data = String::new(); | |
| file.read_to_string(&mut 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
    
  
  
    
  | use std::{env::args, error::Error, fs::File, ops::RangeInclusive, io::Read}; | |
| type PasswordPolicy = (RangeInclusive<u32>, char, String); | |
| fn load_input(path : &str) -> Result<Vec<PasswordPolicy>, std::io::Error> { | |
| let mut file = File::open(path)?; | |
| let mut data = String::new(); | |
| file.read_to_string(&mut 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
    
  
  
    
  | use std::{env::args, error::Error, fs::File, io::Read}; | |
| enum MapEntity { | |
| Tree, | |
| Square | |
| } | |
| struct Map { | |
| pattern : Vec<Vec<MapEntity>>, | 
  
    
      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::{env::args, error::Error, fs::File, io::Read}; | |
| enum MapEntity { | |
| Tree, | |
| Square | |
| } | |
| struct Map { | |
| pattern : Vec<Vec<MapEntity>>, | 
OlderNewer