leetcode只有三个等级,easy,medium,hard,而codeforces则有800-3500,二十多个梯度。大体上,leetcode ...
[LeetCode] Weekly Challenge Perform String Shifts You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: direction can be 0 (for left shift) or 1 (for right shift). amount is the amount by which string s is to be shi...
Given an integer array arr, count element x such that x + 1 is also in arr. If there're duplicates in arr, count them seperately. Example 1: Input: arr = [1,2,3]Output: 2Explanation: 1 and 2 are counted cause 2 and 3 are in arr. Example 2: Input:arr=[1,1,3,3,5,5,7,...