We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 708dd7c commit a7be239Copy full SHA for a7be239
src/0101-0200/119 - Pascals Triangle II/pascals_triangle_ii.rs
@@ -6,7 +6,7 @@ impl Solution {
6
// loop through the vector, starting at 1
7
for i in 1..row_index {
8
// loop through the vector, starting at i + 1 and going backwards
9
- for j in (1..i + 1).rev() {
+ for j in (1..=i).rev() {
10
// add the value at the current index to the value at the previous index
11
row[j as usize] += row[(j - 1) as usize];
12
}
src/0401-0500/476 - Number Complement/num_complement.rs
@@ -1,6 +1,6 @@
1
impl Solution {
2
pub fn find_complement(num: i32) -> i32 {
3
- let mut res = String::new();
+ let mut res = String::default();
4
5
for ch in format!("{:b}", num).chars() {
if ch == '0' {
0 commit comments