作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/largest-palindrome-product/description/ 题目描述 Find the largest palindrome made from the product of two n-digit numbers. Since the result co…
Find the largest palindrome made from the product of two n-digit numbers Since the result could be very large, you should return the largest palindrome mod 1337. Example: Input: 2 Output: 987 Explanation: 99 x 91 = 9009, 9009 % 1337 = 987 Note:The ra…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 HashTable 相似题目 参考资料 日期 题目地址:https://leetcode.com/problems/palindrome-pairs/description/ 题目描述 Given a list of unique words, find all pairs of distinct indices (i, j) in the give…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 回溯法 日期 题目地址:https://leetcode.com/problems/palindrome-partitioning/description/ 题目描述 Given a string s, partition s such that every substring of the partition is a palindrome. Re…
题目要求 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. 题目分析及思路 给定一个平面上的一组点,要求得到由这些点中任意三个所能组成最大面积的三角形.可以对这一组点进行三三组合,然后利用已知三点求三角形面积的公式得到每一组点所对应的三角形面积,最后取其中的最大值即为所求. python代码 class…
题目要求 Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossible to form any triangle of non-zero area, return 0. 题目分析及思路 给定一个正整数数组,要求返回由这些数所能组成的周长最长且面积非零的三角…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 字典 日期 题目地址:https://leetcode-cn.com/problems/palindrome-permutation/ 题目描述 Given a string, determine if a permutation of the string could form a palindrome. Example 1: Input: "cod…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/unique-paths/description/ 题目描述: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either…
你需要找到由两个 n 位数的乘积组成的最大回文数.由于结果会很大,你只需返回最大回文数 mod 1337得到的结果.示例:输入: 2输出: 987解释: 99 x 91 = 9009, 9009 % 1337 = 987说明:n 的取值范围为 [1,8].详见:https://leetcode.com/problems/largest-palindrome-product/description/ C++: class Solution { public: int largestPalindro…
class Solution { public: int largestPalindrome(int n) { vector<,,,,,,,}; ]; } }; 这里的穷举法,你不得不服…