diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/hand_of_straights.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/hand_of_straights.cpp')
-rw-r--r-- | other/hand_of_straights.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/other/hand_of_straights.cpp b/other/hand_of_straights.cpp deleted file mode 100644 index b08c7fa..0000000 --- a/other/hand_of_straights.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - bool isNStraightHand(vector<int> &hand, int groupSize) { - if (hand.size() % groupSize != 0) - return false; - map<int, int> m; - for (auto &card : hand) - m[card]++; - for (int i = 0; i < groupSize; i++) { - int curr = m.begin()->first; - if (m[curr + i] == 0) - return false; - else if (--m[curr + i] < 1) - m.erase(curr + i); - } - return true; - } -}; - -int main() { - Solution obj; - vector<int> hand = {1, 2, 3, 6, 2, 3, 4, 7, 8}; - int groupSize = 3; - if (obj.isNStraightHand(hand, groupSize)) - cout << "true"; - else - cout << "false"; -} |