Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sankichi92 committed Jan 1, 2024
1 parent bdc2152 commit 6dce4d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 74-daily-temperatures/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pub fn daily_temperatures(temperatures: Vec<i32>) -> Vec<i32> {
let mut results = vec![0; temperatures.len()];

let mut no_warmer_days = vec![(0, temperatures[0])];

for (current_day, current_temperature) in temperatures.into_iter().enumerate().skip(1) {
while let Some((day, temperature)) = no_warmer_days.pop() {
while let Some((day, temperature)) = no_warmer_days.pop() {
if current_temperature > temperature {
results[day] = (current_day - day) as i32;
} else {
Expand Down

0 comments on commit 6dce4d5

Please sign in to comment.