Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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; | |
pub fn find_pairs(numbers: &[i32], k: i32) -> Option<(i32, i32)> { | |
let math_mid = numbers.len()/2; | |
let mut large_numbers = numbers[math_mid as usize..].iter(); | |
let mut small_numbers = numbers[..math_mid as usize].iter().rev(); | |
let mut small_numbers_to_larger = large_numbers.clone(); |
This file contains 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
Rust gold gists |
This file contains 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
#![no_main] | |
extern { | |
fn puts(src: *const i8) -> i32; | |
fn getchar() -> *const i8; | |
} | |
#[no_mangle] | |
unsafe extern fn main(argc: isize, argv: *const *const u8) -> isize { | |
puts("Hello, World!\0".as_ptr() as *const i8); |