Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples. Example 1: Input: date1 = "2019-06-29", date2 = "2019-06-30"<br />Output: 1<br />Example 2: Input: date
A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements: The area of the rectangular web page you designed must
Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive). Example 1: Input: low = 3, high = 7<br />Output: 3<br />Explanation: The odd numbers between 3 and 7 are [3,5,7].<br />Example 2: Input: low = 8, high
Given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6). Example 1: Input: num = 9669<br />Output: 9969<br />Explanation: <br />Changing the first dig
Given an integer n. No-Zero integer is a positive integer which doesn't contain any 0 in its decimal representation. Return a list of two integers [A, B] where: A and B are No-Zero integers.<br />A + B = n<br />It's guarateed that there is at least one valid solution. If there are m
Given an integer number n, return the difference between the product of its digits and the sum of its digits.<br /> Example 1: Input: n = 234<br />Output: 15 <br />Explanation: <br />Product of digits = 2 * 3 * 4 = 24 <br />Sum of digits = 2 + 3 + 4 = 9 <br
Given a function f(x, y) and a value z, return all positive integer pairs x and y where f(x,y) == z. The function is constantly increasing, i.e.: f(x, y) < f(x + 1, y)<br />f(x, y) < f(x, y + 1)<br />The function interface is defined like this: interface Cus
Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.) (Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.) Since the answer may be large,
Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year. Example 1: Input: date = "2019-01-09"<br />Output: 9<br />Explanation: Given date is the 9th day of the year in 2019.<br />Example 2: Input: da
We distribute some number of candies, to a row of n = num_people people in the following way: We then give 1 candy to the first person, 2 candies to the second person, and so on until we give n candies to the last person. Then, we go back to the start of the row, giving n + 1 candie
A boomerang is a set of 3 points that are all distinct and not in a straight line. Given a list of three points in the plane, return whether these points are a boomerang. Example 1: Input: [[1,1],[2,3],[3,2]]<br />Output: true<br />Example 2: Input: [[1,1
Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of: Choosing any x with 0 < x < N and N % x == 0.<br />Replacing the number N on the chalkboar