hackerrank rust Implementation (1) 썸네일형 리스트형 [HackerRank] Apple and Orange in Rust vector의 각 element를 동일한 만큼 증가시킴 => map 메서드로 하나씩 처리한 뒤 collect 메서드로 결합. vector의 filter 메서드로 필터링 후 count 구할 수 있음. use std::io::{self, BufRead}; /* * Complete the 'countApplesAndOranges' function below. * * The function accepts following parameters: * 1. INTEGER s * 2. INTEGER t * 3. INTEGER a * 4. INTEGER b * 5. INTEGER_ARRAY apples * 6. INTEGER_ARRAY oranges */ fn countApplesAndOranges(s: i32, t: .. 이전 1 다음