題目: A message containing letters from A-Z is being encoded to numbers using the following mapping way: 'A' -> 1
'B' -> 2
...
'Z' -> 26 Beyond that, now the encoded string can also contain the character ‘*’, whic
傳送門 Description Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return false. Follow up: Could you solve it without loops/recursion? 思路 題意:不
隨便寫下暴力就過了,美版也是 class ProductOfNumbers {vector<int>nums;
public:ProductOfNumbers() {}void add(int num) {nums.push_back(num);}int getProduct(int k) {typedef long long ll;ll res = 1;for(int i = nums.size() - k; i < nums.
題目描述: Given a non-empty string?s, you may delete?at most?one character. Judge whether you can make it a palindrome. leetcode 340?Example 1: Input: "aba"
Output: True ? Example 2: Input: "abca"
Output: True
Explanation: You coul