Leetcode 3084. Count Substrings Starting and Ending with Given Character 1. 解题思路2. 代码实现 题目链接:3084. Count Substrings Starting and Ending with Given Character
1. 解题思路
这一题其实挺简单的,只要看一下目标的character在stri…
/*** 组合** param n 总数* param m 选择个数* return 组合数*/public static int c(int n, int m) {return a(n, m) / j(m);}/*** 排列** param n 总数* param m 选择数* return 排列数*/public static int a(int n, int m) {return j(n) / j(n - m);}/*** 阶乘** param x x&g…
题目描述: KKs Point
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 713 Accepted Submission(s): 238 Problem DescriptionOur lovely KK has a difficult mathematical problem:He points N(2≤…
Leetcode 2929. Distribute Candies Among Children II 1. 解题思路2. 代码实现 题目链接:2929. Distribute Candies Among Children II
1. 解题思路
这一题很惭愧,没能自力搞定,最后是看了大佬的思路之后才做出来的,唉……
这…
A 判断通过操作能否让字符串相等 I s 1 s1 s1和 s 2 s2 s2第 1 1 1、 2 2 2位若同位置不等,则 s 1 s1 s1交换对应的 i i i和 j j j位置,之后判断 s 1 s1 s1和 s 2 s2 s2是否相当 class Solution {
public:bool canBeEqual(string s1, string s2) {for (i…