add: description

This commit is contained in:
Eat-Swap 2022-06-13 23:27:45 +08:00
parent 9ae05b0458
commit 0890a8bef2
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
2 changed files with 19 additions and 0 deletions

12
cpp/2206/220608.cpp Normal file
View File

@ -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
*/

View File

@ -1,6 +1,13 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
/**
* 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 { class Solution {
public: public:
static int heightChecker(const std::vector<int>& h) { static int heightChecker(const std::vector<int>& h) {