摘要:
题目如下: You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x number 阅读全文
摘要:
题目如下: Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slo 阅读全文
摘要:
题目如下: The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are described below: "../" : Move to 阅读全文
摘要:
题目如下: Given an array of positive integers arr, calculate the sum of all possible odd-length subarrays. A subarray is a contiguous subsequence of the a 阅读全文
摘要:
题目如下: Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid. A cycle is a 阅读全文
摘要:
题目如下: You are given a list of preferences for n friends, where n is always even. For each person i, preferences[i] contains a list of friends sorted i 阅读全文
摘要:
题目如下: Given a rows x cols matrix mat, where mat[i][j] is either 0 or 1, return the number of special positions in mat. A position (i,j) is called spec 阅读全文
摘要:
题目如下: You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e. 0 <= i < n). In one operation, you can select two i 阅读全文
摘要:
题目如下: Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. Example 1: Input: arr 阅读全文
摘要:
题目如下: Given two positive integers n and k, the binary string Sn is formed as follows: S1 = "0" Si = Si-1 + "1" + reverse(invert(Si-1)) for i > 1 Where 阅读全文