Blogs Hub

by Sumit Chourasia | Feb 13, 2021

Maximum Number of Balls in a Box - Maths - Easy - LeetCode - MiniTV

Maximum Number of Balls in a Box - Maths - Easy - LeetCode - मिनी टीवी

You are working in a ball factory where you have n balls numbered from lowLimit up to highLimit inclusive (i.e., n == highLimit - lowLimit + 1), and an infinite number of boxes numbered from 1 to infinity. Your job at this factory is to put each ball in the box with a number equal to the s

read more...

by Sumit Chourasia | Jan 26, 2021

Beautiful Arrangement II - Maths - Medium - LeetCode - MiniTV

Beautiful Arrangement II - Maths - Medium - LeetCode - मिनी टीवी

Given two integers n and k, you need to construct a list that contains n different positive integers ranging from 1 to n and obeys the following requirement:<br />Suppose this list is [a1, a2, a3, ... , an], then the list [|a1 - a2|, |a2 - a3|, |a3 - a4|, ... , |an-1 - an|] has exactly k distinct

read more...

by Sumit Chourasia | Jan 10, 2021

Calculate Money in Leetcode Bank - Maths - Easy - LeetCode - MiniTV

Calculate Money in Leetcode Bank - Maths - Easy - LeetCode - मिनी टीवी

Hercy wants to save money for his first car. He puts money in the Leetcode bank every day. He starts by putting in $1 on Monday, the first day. Every day from Tuesday to Sunday, he will put in $1 more than the day before. On every subsequent Monday, he will put in $1 more than the previous

read more...

by Sumit Chourasia | Oct 18, 2020

Number of Days Between Two Dates - Maths - Easy - LeetCode - MiniTV

Number of Days Between Two Dates - Maths - Easy - LeetCode - मिनी टीवी

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. &nbsp; Example 1: Input: date1 = "2019-06-29", date2 = "2019-06-30"<br />Output: 1<br />Example 2: Input: date

read more...

by Sumit Chourasia | Oct 17, 2020

Construct the Rectangle - Maths - Easy - LeetCode - MiniTV

Construct the Rectangle - Maths - Easy - LeetCode - मिनी टीवी

A web developer needs to know how to design a web page's size. So, given a specific rectangular web page&rsquo;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

read more...

by Sumit Chourasia | Oct 02, 2020

Count Odd Numbers in an Interval Range - Math - Easy - LeetCode - MiniTV

Count Odd Numbers in an Interval Range - Math - Easy - LeetCode - मिनी टीवी

Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive). &nbsp; 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

read more...

by Sumit Chourasia | Oct 02, 2020

Maximum 69 Number - Math - Easy - LeetCode - MiniTV

Maximum 69 Number - Math - Easy - LeetCode - मिनी टीवी

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). &nbsp; Example 1: Input: num = 9669<br />Output: 9969<br />Explanation:&nbsp;<br />Changing the first dig

read more...

by Sumit Chourasia | Oct 02, 2020

Convert Integer to the Sum of Two No-Zero Integers - Math - Easy - LeetCode - MiniTV

Convert Integer to the Sum of Two No-Zero Integers - Math - Easy - LeetCode - मिनी टीवी

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

read more...

by Sumit Chourasia | Oct 02, 2020

Subtract the Product and Sum of Digits of an Integer - Math - Easy - LeetCode - MiniTV

Subtract the Product and Sum of Digits of an Integer - Math - Easy - LeetCode - मिनी टीवी

Given an integer number n, return the difference between the product of its digits and the sum of its digits.<br />&nbsp; Example 1: Input: n = 234<br />Output: 15&nbsp;<br />Explanation:&nbsp;<br />Product of digits = 2 * 3 * 4 = 24&nbsp;<br />Sum of digits = 2 + 3 + 4 = 9&nbsp;<br

read more...

by Sumit Chourasia | Oct 02, 2020

Find Positive Integer Solution for a Given Equation - Math - Easy - LeetCode - MiniTV

Find Positive Integer Solution for a Given Equation - Math - Easy - LeetCode - मिनी टीवी

Given a function &nbsp;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) &lt; f(x + 1, y)<br />f(x, y) &lt; f(x, y + 1)<br />The function interface is defined like this:&nbsp; interface Cus

read more...

by Sumit Chourasia | Oct 02, 2020

Prime Arrangements - Math - Easy - LeetCode - MiniTV

Prime Arrangements - Math - Easy - LeetCode - मिनी टीवी

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,

read more...

by Sumit Chourasia | Oct 01, 2020

Day of the Year - Math - Easy - LeetCode - MiniTV

Day of the Year - Math - Easy - LeetCode - मिनी टीवी

Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year. &nbsp; 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

read more...