From 8e5e7c1d84a7073666448757161e4eb27ccc00d1 Mon Sep 17 00:00:00 2001 From: eat-swap Date: Sun, 17 Apr 2022 13:07:41 +0800 Subject: [PATCH] add: description [cpp] --- cpp/2204/220417-CN.cpp | 6 ++++++ cpp/2204/220417.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/cpp/2204/220417-CN.cpp b/cpp/2204/220417-CN.cpp index 67c242b..2719183 100644 --- a/cpp/2204/220417-CN.cpp +++ b/cpp/2204/220417-CN.cpp @@ -5,6 +5,12 @@ #include #include +/** + * 819. Most Common Word + * Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and that the answer is unique. + * The words in paragraph are case-insensitive and the answer should be returned in lowercase. + */ + class Solution { public: static std::string mostCommonWord(std::string paragraph, const std::vector& banned) { diff --git a/cpp/2204/220417.cpp b/cpp/2204/220417.cpp index 6baade9..3f0d7ea 100644 --- a/cpp/2204/220417.cpp +++ b/cpp/2204/220417.cpp @@ -8,6 +8,11 @@ struct TreeNode { explicit TreeNode(int x = 0, TreeNode* l = nullptr, TreeNode* r = nullptr) : val(x), left(l), right(r) {} }; +/** + * 897. Increasing Order Search Tree + * Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child. + */ + class Solution { public: static TreeNode* increasingBST(TreeNode* root, TreeNode* greater = nullptr) {