subarray division rust (1) 썸네일형 리스트형 [HackerRank] Subarray Division in Rust use std::env; use std::fs::File; use std::io::{self, BufRead, Write}; /* * Complete the 'birthday' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. INTEGER_ARRAY s * 2. INTEGER d * 3. INTEGER m */ fn birthday(s: &[i32], d: i32, m: i32) -> i32 { let mut result = 0; for i in 0..s.len() as i32 { if i+m > s.len() as i32 { break; } l.. 이전 1 다음