add: description
This commit is contained in:
parent
bf1382494e
commit
c19b115904
|
|
@ -1,6 +1,12 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 564. Find the Closest Palindrome
|
||||||
|
* Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.
|
||||||
|
* The closest is defined as the absolute difference minimized between two integers.
|
||||||
|
*/
|
||||||
|
|
||||||
class Solution {
|
class Solution {
|
||||||
private:
|
private:
|
||||||
static inline constexpr unsigned long long diffULL(unsigned long long x, unsigned long long y) {
|
static inline constexpr unsigned long long diffULL(unsigned long long x, unsigned long long y) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 392. Is Subsequence
|
||||||
|
* Given two strings s and t, return true if s is a subsequence of t, or false otherwise.
|
||||||
|
* A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).
|
||||||
|
*/
|
||||||
|
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
static bool isSubsequence(const std::string& t, const std::string& s) {
|
static bool isSubsequence(const std::string& t, const std::string& s) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue