aboutsummaryrefslogtreecommitdiff
path: root/challenge-074
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2020-08-23 16:16:53 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2020-08-23 16:16:53 +0100
commit5136afa4aa61688c92f6c58e777a4cc8742e7c90 (patch)
tree3d0e18030f1116763f2c72a6e05079002b2ea0a7 /challenge-074
parent917355a306a941d9cc1e38958efa8cd1b40a31ea (diff)
downloadperlweeklychallenge-club-5136afa4aa61688c92f6c58e777a4cc8742e7c90.tar.gz
perlweeklychallenge-club-5136afa4aa61688c92f6c58e777a4cc8742e7c90.tar.bz2
perlweeklychallenge-club-5136afa4aa61688c92f6c58e777a4cc8742e7c90.zip
- Removed duplicate entry.
Diffstat (limited to 'challenge-074')
-rw-r--r--challenge-074/ash/raku/ch-1.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/challenge-074/ash/raku/ch-1.cpp b/challenge-074/ash/raku/ch-1.cpp
deleted file mode 100644
index 74d78a32c3..0000000000
--- a/challenge-074/ash/raku/ch-1.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Task 1 from
- https://perlweeklychallenge.org/blog/perl-weekly-challenge-074/
-
- Comments: https://andrewshitov.com/2020/08/18/the-weekly-challenge-for-74/
-
- Compile as:
- $ g++ --std=c++17 ch-1.cpp
-*/
-
-#include <iostream>
-#include <vector>
-#include <map>
-#include <algorithm>
-
-using namespace std;
-
-int main() {
- vector<int> data = {1, 2, 2, 3, 2, 4, 2};
- // vector<int> data = {1, 3, 1, 2, 4, 5};
-
- map<int, int> frequency;
- int max_frequency = 0;
- int major = 0;
- for (auto x : data) {
- if (++frequency[x] > max_frequency) {
- max_frequency = frequency[x];
- major = x;
- }
- }
-
- cout << (max_frequency > data.size() / 2 ? major : -1) << endl;
-}