-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path2396.cpp
More file actions
37 lines (37 loc) · 966 Bytes
/
2396.cpp
File metadata and controls
37 lines (37 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Solution {
public:
bool isStrictlyPalindromic(int n) {
return false;
}
};
// class Solution {
// public:
// string toBase(int n, int base) {
// string res;
// while (n) {
// int remain = n % base;
// n /= base;
// res.push_back('0' + remain);
// }
// reverse(res.begin(), res.end());
// return res;
// }
// bool isPalindromic(string& s) {
// int left = 0;
// int right = s.size() - 1;
// while (left < right) {
// if (s[left] != s[right]) return false;
// left++;
// right--;
// }
// return true;
// }
// bool isStrictlyPalindromic(int n) {
// int end = n - 2;
// for (int base = 2; base <= end; ++base) {
// string res = toBase(n, base);
// if (!isPalindromic(res)) return false;
// }
// return true;
// }
// };