aboutsummaryrefslogtreecommitdiff
path: root/other/partition_array_pivot.rs
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
committerJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
commita96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch)
treee2a2b3f49f9fb741be81415266ac93e74cff42ec /other/partition_array_pivot.rs
parent694ad5ed71edcb1deccab54b72d706b779918276 (diff)
downloadleetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz
leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/partition_array_pivot.rs')
-rw-r--r--other/partition_array_pivot.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/other/partition_array_pivot.rs b/other/partition_array_pivot.rs
deleted file mode 100644
index 8a126da..0000000
--- a/other/partition_array_pivot.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-struct Solution;
-
-impl Solution {
- pub fn pivot_array(nums: Vec<i32>, pivot: i32) -> Vec<i32> {
- let mut greater = vec![];
- let mut same = 0;
- let ans = vec![];
- for n in nums {
- if n < pivot {
- ans.push(n);
- } else if n == pivot {
- same += 1;
- } else {
- greater.push(n);
- }
- }
- for _ in 0..same {
- ans.push(pivot);
- }
- for g in greater {
- ans.push(g);
- }
- ans
- }
-}
-
-fn main() {
- let s = Solution;
- let nums = vec![9,12,5,10,14,3,10];
- let pivot = 10;
- print!("{}", s.pivot_array(nums, pivot));
-}