20241024 finished.

This commit is contained in:
2024-10-24 09:08:13 +08:00
parent 3102da99a8
commit bce8de1c85
266 changed files with 2321 additions and 2014 deletions

View File

@@ -3,7 +3,6 @@
*/
pub struct Solution {}
// submission codes start here
impl Solution {
@@ -16,11 +15,7 @@ impl Solution {
candidate = i;
}
count += if candidate == i {
1
} else {
-1
};
count += if candidate == i { 1 } else { -1 };
}
candidate
@@ -35,6 +30,6 @@ mod tests {
#[test]
fn test_169() {
assert_eq!(3, Solution::majority_element(vec![3,2,3]));
assert_eq!(3, Solution::majority_element(vec![3, 2, 3]));
}
}