aboutsummaryrefslogtreecommitdiff
path: root/other/discount_n_orders.cpp
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/discount_n_orders.cpp
parent694ad5ed71edcb1deccab54b72d706b779918276 (diff)
downloadleetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz
leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/discount_n_orders.cpp')
-rw-r--r--other/discount_n_orders.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/other/discount_n_orders.cpp b/other/discount_n_orders.cpp
deleted file mode 100644
index a76d21e..0000000
--- a/other/discount_n_orders.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "leetcode.h"
-
-class Cashier {
-public:
- Cashier(int n, int discount, vector<int> &products, vector<int> &prices) {
- count = 0, mod = n, pct = (100.0 - discount) / 100.0;
- for (int i = 0; i < products.size(); ++i)
- tags[products[i]] = prices[i];
- }
- double getBill(vector<int> product, vector<int> amount) {
- count++;
- double ans(0.0);
- for (int i = 0; i < product.size(); ++i)
- ans += tags[product[i]] * amount[i];
- return count % mod ? ans : ans * pct;
- }
-
-private:
- unordered_map<int, int> tags;
- int count, mod;
- double pct;
-};
-
-int main() {
- Cashier *obj = new Cashier(n, discount, products, prices);
- double param_1 = obj->getBill(product, amount);
-}