diff --git a/cpp/2206/220608.cpp b/cpp/2206/220608.cpp new file mode 100644 index 0000000..ccada65 --- /dev/null +++ b/cpp/2206/220608.cpp @@ -0,0 +1,12 @@ +/** + * 1332. Remove Palindromic Subsequences + * You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s. + * + * Return the minimum number of steps to make the given string empty. + * + * A string is a subsequence of a given string if it is generated by deleting some characters of a given string without changing its order. Note that a subsequence does not necessarily need to be contiguous. + * + * A string is called palindrome if is one that reads the same backward as well as forward. + * + * Refer: 220122-CN.cpp + */ \ No newline at end of file diff --git a/cpp/2206/220613-CN.cpp b/cpp/2206/220613-CN.cpp index 65125c0..201166e 100644 --- a/cpp/2206/220613-CN.cpp +++ b/cpp/2206/220613-CN.cpp @@ -1,6 +1,13 @@ #include #include +/** + * 1051. Height Checker + * A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line. + * You are given an integer array heights representing the current order that the students are standing in. Each heights[i] is the height of the ith student in line (0-indexed). + * Return the number of indices where heights[i] != expected[i]. + */ + class Solution { public: static int heightChecker(const std::vector& h) {