20240323 Finished
This commit is contained in:
parent
925e9051e2
commit
5e9c813800
|
@ -78,4 +78,5 @@ mod p2312_selling_pieces_of_wood;
|
|||
mod p2684_maximum_number_of_moves_in_a_grid;
|
||||
mod p310_minimum_height_trees;
|
||||
mod p303_range_sum_query_immutable;
|
||||
mod p1793_maximum_score_of_a_good_subarray;
|
||||
mod p1793_maximum_score_of_a_good_subarray;
|
||||
mod p2549_count_distinct_numbers_on_board;
|
28
src/problem/p2549_count_distinct_numbers_on_board.rs
Normal file
28
src/problem/p2549_count_distinct_numbers_on_board.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* [2549] Count Distinct Numbers on Board
|
||||
*/
|
||||
pub struct Solution {}
|
||||
|
||||
|
||||
// submission codes start here
|
||||
|
||||
impl Solution {
|
||||
pub fn distinct_integers(n: i32) -> i32 {
|
||||
return if n == 1 {
|
||||
1
|
||||
} else {
|
||||
n - 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// submission codes end
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_2549() {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user