Blogs Hub

by Sumit Chourasia | Mar 31, 2021

Minimum Changes To Make Alternating Binary String - String - Easy - LeetCode - MiniTV

Minimum Changes To Make Alternating Binary String - String - Easy - LeetCode - मिनी टीवी

You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa. The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not.

read more...

by Sumit Chourasia | Mar 31, 2021

Check if Array Is Sorted and Rotated - Array - Easy - LeetCode - MiniTV

Check if Array Is Sorted and Rotated - Array - Easy - LeetCode - मिनी टीवी

Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false. There may be duplicates in the original array. Note: An array A rotated by x positions results in an array B

read more...

by Sumit Chourasia | Feb 13, 2021

Sum of Unique Elements - Array - Easy - LeetCode - MiniTV

Sum of Unique Elements - Array - Easy - LeetCode - मिनी टीवी

You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in the array. Return the sum of all the unique elements of nums. &nbsp; Example 1: Input: nums = [1,2,3,2]<br />Output: 4<br />Explanation: The unique element

read more...

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

Latest Time by Replacing Hidden Digits - String - Easy - LeetCode - MiniTV

Latest Time by Replacing Hidden Digits - String - Easy - LeetCode - मिनी टीवी

You are given a string time in the form of hh:mm, where some of the digits in the string are hidden (represented by ?). The valid times are those inclusively between 00:00 and 23:59. Return the latest valid time you can get from time by replacing the hidden digits. &nbsp;

read more...

by Sumit Chourasia | Jan 26, 2021

Find the Highest Altitude - Array - Easy - LeetCode - MiniTV

Find the Highest Altitude - Array - Easy - LeetCode - मिनी टीवी

There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i​​​​​​ and i + 1 for a

read more...

by Sumit Chourasia | Jan 18, 2021

Number Of Rectangles That Can Form The Largest Square - Array - Easy - LeetCode - MiniTV

Number Of Rectangles That Can Form The Largest Square - Array - Easy - LeetCode - मिनी टीवी

You are given an array rectangles where rectangles[i] = [li, wi] represents the ith rectangle of length li and width wi. You can cut the ith rectangle to form a square with a side length of k if both k &lt;= li and k &lt;= wi. For example, if you have a rectangle [4,6], you can cut it to g

read more...

by Sumit Chourasia | Jan 10, 2021

Decode XORed Array - Array - Easy - LeetCode - MiniTV

Decode XORed Array - Array - Easy - LeetCode - मिनी टीवी

There is a hidden integer array arr that consists of n non-negative integers. It was encoded into another integer array encoded of length n - 1, such that encoded[i] = arr[i] XOR arr[i + 1]. For example, if arr = [1,0,2,1], then encoded = [1,2,3]. You are given the encoded array. Yo

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 | Jan 08, 2021

Maximum Units on a Truck - Array - Easy - LeetCode - MiniTV

Maximum Units on a Truck - Array - Easy - LeetCode - मिनी टीवी

You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]: numberOfBoxesi is the number of boxes of type i.<br />numberOfUnitsPerBoxi is the number of units in each box of the type i.<br />You

read more...

by Sumit Chourasia | Jan 08, 2021

Determine if String Halves Are Alike - String - Easy - LeetCode - MiniTV

Determine if String Halves Are Alike - String - Easy - LeetCode - मिनी टीवी

You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half. Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains upperca

read more...

by Sumit Chourasia | Jan 06, 2021

Number of Students Unable to Eat Lunch - String - Easy - LeetCode - MiniTV

Number of Students Unable to Eat Lunch - String - Easy - LeetCode - मिनी टीवी

The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches. The number of sandwiches in the cafeteria is equal to the number of students. Th

read more...