摘要:
给定两个字符串, A 和 B。 A 的旋转操作就是将 A 最左边的字符移动到最右边。 例如, 若 A = 'abcde',在移动一次之后结果就是'bcdea' 。如果在若干次旋转操作之后,A 能变成B,那么返回True。 示例 1:输入: A = 'abcde', B = 'cdeab'输出: tr 阅读全文
摘要:
class Solution: def majorityElement(self, nums): c = [] for i in set(nums): c.append(nums.count(int(i))) return list(set(nums))[c.index(max(c))] 阅读全文
摘要:
#include<iostream> using namespace std; int Factorials(int n) { if (n == 0) return 1; else return n*Factorials(n-1); } int Factorialssum(int b) { int 阅读全文