{"results":[{"Qdata":"You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. There is a river at x = -1 that you can refill your watering can at. Each plant needs a specific amount of water. You will water the plants in the following way: Water the plants in order from left to right. After watering the current plant, if you do not have enough water to completely water the next plant, return to the river to fully refill the watering can. You cannot refill the watering can early. You are initially at the river (i.e., x = -1). It takes one step to move one unit on the x-axis. Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and an integer capacity representing the watering can capacity, return the number of steps needed to water all the plants.\n","Qlink":"https://leetcode.com/problems/watering-plants\n","platform":"leetcode\n","pname":"Watering Plants\n","score":0.0},{"Qdata":"Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums. A subarray is defined as a contiguous sequence of numbers in an array. A subarray [numsl, numsl+1, ..., numsr-1, numsr] is ascending if for all i where l <= i < r, numsi  < numsi+1. Note that a subarray of size 1 is ascending.\n","Qlink":"https://leetcode.com/problems/maximum-ascending-subarray-sum\n","platform":"leetcode\n","pname":"Maximum Ascending Subarray Sum\n","score":0.0},{"Qdata":"You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides. Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left. A board that redirects the ball to the right spans the top-left corner to the bottom-right corner and is represented in the grid as 1. A board that redirects the ball to the left spans the top-right corner to the bottom-left corner and is represented in the grid as -1. We drop one ball at the top of each column of the box. Each ball can get stuck in the box or fall out of the bottom. A ball gets stuck if it hits a \"V\" shaped pattern between two boards or if a board redirects the ball into either wall of the box. Return an array answer of size n where answer[i] is the column that the ball falls out of at the bottom after dropping the ball from the ith column at the top, or -1 if the ball gets stuck in the box.\n","Qlink":"https://leetcode.com/problems/where-will-the-ball-fall\n","platform":"leetcode\n","pname":"Where Will the Ball Fall\n","score":0.0},{"Qdata":"Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at second t will mean Ashe is poisoned during the inclusive time interval [t, t + duration - 1]. If Teemo attacks again before the poison effect ends, the timer for it is reset, and the poison effect will end duration seconds after the new attack. You are given a non-decreasing integer array timeSeries, where timeSeries[i] denotes that Teemo attacks Ashe at second timeSeries[i], and an integer duration. Return the total number of seconds that Ashe is poisoned.\n","Qlink":"https://leetcode.com/problems/teemo-attacking\n","platform":"leetcode\n","pname":"Teemo Attacking\n","score":0.0},{"Qdata":"Given a positive integer n, you can apply one of the following operations: If n is even, replace n with n / 2. If n is odd, replace n with either n + 1 or n - 1. Return the minimum number of operations needed for n to become 1.\n","Qlink":"https://leetcode.com/problems/integer-replacement\n","platform":"leetcode\n","pname":"Integer Replacement\n","score":0.0},{"Qdata":"There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself. You want to determine if there is a valid path that exists from vertex source to vertex destination. Given edges and the integers n, source, and destination, return true if there is a valid path from source to destination, or false otherwise.\n","Qlink":"https://leetcode.com/problems/find-if-path-exists-in-graph\n","platform":"leetcode\n","pname":"Find if Path Exists in Graph\n","score":0.0},{"Qdata":"You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1. Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner. Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops. We will remove exactly one node from initial. Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index. Note that if a node was removed from the initial list of infected nodes, it might still be infected later due to the malware spread.\n","Qlink":"https://leetcode.com/problems/minimize-malware-spread\n","platform":"leetcode\n","pname":"Minimize Malware Spread\n","score":0.0},{"Qdata":"There is a room with n bulbs labeled from 1 to n that all are turned on initially, and four buttons on the wall. Each of the four buttons has a different functionality where: Button 1: Flips the status of all the bulbs. Button 2: Flips the status of all the bulbs with even labels (i.e., 2, 4, ...). Button 3: Flips the status of all the bulbs with odd labels (i.e., 1, 3, ...). Button 4: Flips the status of all the bulbs with a label j = 3k + 1 where k = 0, 1, 2, ... (i.e., 1, 4, 7, 10, ...). You must make exactly presses button presses in total. For each press, you may pick any of the four buttons to press. Given the two integers n and presses, return the number of different possible statuses after performing all presses button presses.\n","Qlink":"https://leetcode.com/problems/bulb-switcher-ii\n","platform":"leetcode\n","pname":"Bulb Switcher II\n","score":0.0},{"Qdata":"We have n cities labeled from 1 to n. Two different cities with labels x and y are directly connected by a bidirectional road if and only if x and y share a common divisor strictly greater than some threshold. More formally, cities with labels x and y have a road between them if there exists an integer z such that all of the following are true: x % z == 0, y % z == 0, and z > threshold. Given the two integers, n and threshold, and an array of queries, you must determine for each queries[i] = [ai, bi] if cities ai and bi are connected directly or indirectly. (i.e. there is some path between them). Return an array answer, where answer.length == queries.length and answer[i] is true if for the ith query, there is a path between ai and bi, or answer[i] is false if there is no path.\n","Qlink":"https://leetcode.com/problems/graph-connectivity-with-threshold\n","platform":"leetcode\n","pname":"Graph Connectivity With Threshold\n","score":0.0},{"Qdata":"Given a 0-indexed integer array nums, return the number of distinct quadruplets (a, b, c, d) such that: nums[a] + nums[b] + nums[c] == nums[d], and a < b < c < d\n","Qlink":"https://leetcode.com/problems/count-special-quadruplets\n","platform":"leetcode\n","pname":"Count Special Quadruplets\n","score":0.0},{"Qdata":"You have a 1-indexed binary string of length n where all the bits are 0 initially. We will flip all the bits of this binary string (i.e., change them from 0 to 1) one by one. You are given a 1-indexed integer array flips where flips[i] indicates that the bit at index i will be flipped in the ith step. A binary string is prefix-aligned if, after the ith step, all the bits in the inclusive range [1, i] are ones and all the other bits are zeros. Return the number of times the binary string is prefix-aligned during the flipping process.\n","Qlink":"https://leetcode.com/problems/number-of-times-binary-string-is-prefix-aligned\n","platform":"leetcode\n","pname":"Number of Times Binary String Is Prefix-Aligned\n","score":0.0},{"Qdata":"Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.\n","Qlink":"https://leetcode.com/problems/increasing-order-search-tree\n","platform":"leetcode\n","pname":"Increasing Order Search Tree\n","score":0.0},{"Qdata":"Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.\n","Qlink":"https://leetcode.com/problems/isomorphic-strings\n","platform":"leetcode\n","pname":"Isomorphic Strings\n","score":0.0},{"Qdata":"You are given an integer array nums sorted in non-decreasing order. Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute differences between nums[i] and all the other elements in the array. In other words, result[i] is equal to sum(|nums[i]-nums[j]|) where 0 <= j < nums.length and j != i (0-indexed).\n","Qlink":"https://leetcode.com/problems/sum-of-absolute-differences-in-a-sorted-array\n","platform":"leetcode\n","pname":"Sum of Absolute Differences in a Sorted Array\n","score":0.0},{"Qdata":"You are given n points in the plane that are all distinct, where points[i] = [xi, yi]. A boomerang is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters). Return the number of boomerangs.\n","Qlink":"https://leetcode.com/problems/number-of-boomerangs\n","platform":"leetcode\n","pname":"Number of Boomerangs\n","score":0.0},{"Qdata":"You are given two strings s and t of the same length and an integer maxCost. You want to change s to t. Changing the ith character of s to ith character of t costs |s[i] - t[i]| (i.e., the absolute difference between the ASCII values of the characters). Return the maximum length of a substring of s that can be changed to be the same as the corresponding substring of t with a cost less than or equal to maxCost. If there is no substring from s that can be changed to its corresponding substring from t, return 0.\n","Qlink":"https://leetcode.com/problems/get-equal-substrings-within-budget\n","platform":"leetcode\n","pname":"Get Equal Substrings Within Budget\n","score":0.0},{"Qdata":"Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. The array is said to be good if you can obtain a sum of 1 from the array by any possible subset and multiplicand. Return True if the array is good otherwise return False.\n","Qlink":"https://leetcode.com/problems/check-if-it-is-a-good-array\n","platform":"leetcode\n","pname":"Check If It Is a Good Array\n","score":0.0},{"Qdata":"You are given an integer array nums. The adjacent integers in nums will perform the float division. For example, for nums = [2,3,4], we will evaluate the expression \"2/3/4\". However, you can add any number of parenthesis at any position to change the priority of operations. You want to add these parentheses such the value of the expression after the evaluation is maximum. Return the corresponding expression that has the maximum value in string format. Note: your expression should not contain redundant parenthesis.\n","Qlink":"https://leetcode.com/problems/optimal-division\n","platform":"leetcode\n","pname":"Optimal Division\n","score":0.0},{"Qdata":"You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take from nums such that the sum of its elements is less than or equal to queries[i]. A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.\n","Qlink":"https://leetcode.com/problems/longest-subsequence-with-limited-sum\n","platform":"leetcode\n","pname":"Longest Subsequence With Limited Sum\n","score":0.0},{"Qdata":"You are given a positive integer n. Each digit of n has a sign according to the following rules: The most significant digit is assigned a positive sign. Each other digit has an opposite sign to its adjacent digits. Return the sum of all digits with their corresponding sign.\n","Qlink":"https://leetcode.com/problems/alternating-digit-sum\n","platform":"leetcode\n","pname":"Alternating Digit Sum\n","score":0.0},{"Qdata":"A password is considered strong if the below conditions are all met: It has at least 6 characters and at most 20 characters. It contains at least one lowercase letter, at least one uppercase letter, and at least one digit. It does not contain three repeating characters in a row (i.e., \"Baaabb0\" is weak, but \"Baaba0\" is strong). Given a string password, return the minimum number of steps required to make password strong. if password is already strong, return 0. In one step, you can: Insert one character to password, Delete one character from password, or Replace one character of password with another character.\n","Qlink":"https://leetcode.com/problems/strong-password-checker\n","platform":"leetcode\n","pname":"Strong Password Checker\n","score":0.0},{"Qdata":"Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = \"dcce\" then f(s) = 2 because the lexicographically smallest character is 'c', which has a frequency of 2. You are given an array of strings words and another array of query strings queries. For each query queries[i], count the number of words in words such that f(queries[i]) < f(W) for each W in words. Return an integer array answer, where each answer[i] is the answer to the ith query.\n","Qlink":"https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character\n","platform":"leetcode\n","pname":"Compare Strings by Frequency of the Smallest Character\n","score":0.0},{"Qdata":"SQL Schema Table: Tree +-------------+------+ | Column Name | Type | +-------------+------+ | id          | int  | | p_id        | int  | +-------------+------+ id is the primary key column for this table. Each row of this table contains information about the id of a node and the id of its parent node in a tree. The given structure is always a valid tree. Each node in the tree can be one of three types: \"Leaf\": if the node is a leaf node. \"Root\": if the node is the root of the tree. \"Inner\": If the node is neither a leaf node nor a root node. Write an SQL query to report the type of each node in the tree. Return the result table in any order. The query result format is in the following example.\n","Qlink":"https://leetcode.com/problems/tree-node\n","platform":"leetcode\n","pname":"Tree Node\n","score":0.0},{"Qdata":"Given two integers num and k, consider a set of positive integers with the following properties: The units digit of each integer is k. The sum of the integers is num. Return the minimum possible size of such a set, or -1 if no such set exists. Note: The set can contain multiple instances of the same integer, and the sum of an empty set is considered 0. The units digit of a number is the rightmost digit of the number.\n","Qlink":"https://leetcode.com/problems/sum-of-numbers-with-units-digit-k\n","platform":"leetcode\n","pname":"Sum of Numbers With Units Digit K\n","score":0.0},{"Qdata":"Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest product of nums1[i] * nums2[j] where 0 <= i < nums1.length and 0 <= j < nums2.length.\n","Qlink":"https://leetcode.com/problems/kth-smallest-product-of-two-sorted-arrays\n","platform":"leetcode\n","pname":"Kth Smallest Product of Two Sorted Arrays\n","score":0.0},{"Qdata":"You are given a 0-indexed integer array nums. You are allowed to permute nums into a new array perm of your choosing. We define the greatness of nums be the number of indices 0 <= i < nums.length for which perm[i] > nums[i]. Return the maximum possible greatness you can achieve after permuting nums.\n","Qlink":"https://leetcode.com/problems/maximize-greatness-of-an-array\n","platform":"leetcode\n","pname":"Maximize Greatness of an Array\n","score":0.0},{"Qdata":"You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you could choose any m (1 <= m <= n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time. Given an integer array machines representing the number of dresses in each washing machine from left to right on the line, return the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1.\n","Qlink":"https://leetcode.com/problems/super-washing-machines\n","platform":"leetcode\n","pname":"Super Washing Machines\n","score":0.0},{"Qdata":"SQL Schema Table: Project +-------------+---------+ | Column Name | Type    | +-------------+---------+ | project_id  | int     | | employee_id | int     | +-------------+---------+ (project_id, employee_id) is the primary key of this table. employee_id is a foreign key to Employee table. Each row of this table indicates that the employee with employee_id is working on the project with project_id. Table: Employee +------------------+---------+ | Column Name      | Type    | +------------------+---------+ | employee_id      | int     | | name             | varchar | | experience_years | int     | +------------------+---------+ employee_id is the primary key of this table. It's guaranteed that experience_years is not NULL. Each row of this table contains information about one employee. Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits. Return the result table in any order. The query result format is in the following example.\n","Qlink":"https://leetcode.com/problems/project-employees-i\n","platform":"leetcode\n","pname":"Project Employees I\n","score":0.0},{"Qdata":"Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones.\n","Qlink":"https://leetcode.com/problems/non-negative-integers-without-consecutive-ones\n","platform":"leetcode\n","pname":"Non-negative Integers without Consecutive Ones\n","score":0.0},{"Qdata":"Given an integer array nums containing n integers, find the beauty of each subarray of size k. The beauty of a subarray is the xth smallest integer in the subarray if it is negative, or 0 if there are fewer than x negative integers. Return an integer array containing n - k + 1 integers, which denote the beauty of the subarrays in order from the first index in the array. A subarray is a contiguous non-empty sequence of elements within an array.\n","Qlink":"https://leetcode.com/problems/sliding-subarray-beauty\n","platform":"leetcode\n","pname":"Sliding Subarray Beauty\n","score":0.0}]}
