Latest Posts

CreateBlog Picture

287. Find the Duplicate Number Solution | Leetcode | Binary Search

Raunit Verma- inLeetcode

Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums and using only constant extra space.

CreateBlog Picture

B. Worms Solution | Binary Search | Codeforces Round 271 (Div. 2)

Raunit Verma- inCodeforces

It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such that i-th pile contains ai worms. He labeled all these worms with consecutive integers: worms in first pile are labeled with numbers 1 to a1, worms in second pile are labeled with numbers a1 + 1 to a1 + a2 and so on. See the example for a better understanding. Mole can't eat all the worms (Marmot brought a lot) and, as we all know, Mole is blind, so Marmot tells him the labels of the best juicy worms. Marmot will only give Mole a worm if Mole says correctly in which pile this worm is contained. Poor Mole asks for your help. For all juicy worms said by Marmot, tell Mole the correct answers.

CreateBlog Picture

878. Nth Magical Number Solution | LeetCode | Binary Search

Raunit Verma- inLeetcode

A positive integer is magical if it is divisible by either a or b. Given the three integers n, a, and b, return the nth magical number. Since the answer may be very large, return it modulo 109 + 7.

CreateBlog Picture

1482. Minimum Number of Days to Make m Bouquets Solution | Leetcode | Binary Search

Raunit Verma- inLeetcode

You are given an integer array bloomDay, an integer m and an integer k. You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden. The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet. Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.

CreateBlog Picture

Array Division Solution with Explanation | CSES Problem Set | Binary Search

Raunit Verma- inCSES

You are given an array containing n positive integers. Your task is to divide the array into k subarrays so that the maximum sum in a subarray is as small as possible.

CreateBlog Picture

Multiplication Table CSES Solution | CSES Problem Set | Binary Search

Raunit Verma- inCSES

Find the middle element when the numbers in an n \times n multiplication table are sorted in increasing order. It is assumed that n is odd. For example, the 3 \times 3 multiplication table is as follows:

CreateBlog Picture

Factory Machines CSES Solution | CSES Problem Set | Binary Search

Raunit Verma- inCSES

A factory has n machines which can be used to make products. Your goal is to make a total of t products. For each machine, you know the number of seconds it needs to make a single product. The machines can work simultaneously, and you can freely decide their schedule. What is the shortest time needed to make t products?

CreateBlog Picture

3728. Stable Subarrays With Equal Boundary and Interior Sum | LeetCode Solution

Raunit Verma- inLeetcode

You are given an integer array capacity. A subarray capacity[l..r] is considered stable if: Its length is at least 3. The first and last elements are each equal to the sum of all elements strictly between them (i.e., capacity[l] = capacity[r] = capacity[l + 1] + capacity[l + 2] + ... + capacity[r - 1]). Return an integer denoting the number of stable subarrays.

CreateBlog Picture

Google OAuth vs One Tap vs FedCM – Choosing the Right Authentication for Seamless Login

CodingKaro- inProjects

Many developers confuse Google OAuth, Google One Tap, and the new FedCM (Federated Credential Management). While they all enable users to log in with their Google account, each offers a different balance of security, user experience, and integration flow.

CreateBlog Picture

Understanding Modular Exponentiation (modPow) for Beginners

Raunit Verma- inC++

Learn how to compute ab mod m efficiently using the binary exponentiation method in C++. A must-know technique for competitive programming and cryptography.

CreateBlog Picture

A Guide to Affordable VPS Providers for Side Projects | Cheapest VPS/Servers/Instance for Side Projects

Raunit Verma- inProjects

How to Find Budget-Friendly VPS Solutions for Students

CreateBlog Picture

Deploy Your Own Email Validator | Unlimited Email Validator [Email Verifier for Free] AfterShip OSS

Raunit Verma- inProjects

Validate your email lists effortlessly with our unlimited email validator. Deploy your own email verifier for free and enhance your email marketing strategy today. Ensure your emails reach the right inboxes with our free, unlimited email validator. Deploy your own email verifier and boost your marketing effectiveness now. Optimize your email campaigns with our free email validator. Deploy your own unlimited email verifier and improve deliverability with ease. Start validating today!

CreateBlog Picture

B. Playing in a Casino | Codeforces Solution | Codeforces Round 861 (Div. 2)

Raunit Verma- inCodeforces

Galaxy Luck, a well-known casino in the entire solar system, introduces a new card game. In this game, there is a deck that consists of 𝑛 cards. Each card has 𝑚 numbers written on it. Each of the 𝑛 players receives exactly one card from the deck. Then all players play with each other in pairs, and each pair of players plays exactly once. Thus, if there are, for example, four players in total, then six games are played: the first against the second, the first against the third, the first against the fourth, the second against the third, the second against the fourth and the third against the fourth.

CreateBlog Picture

D. Plus Minus Permutation | Codeforces Solution | Codeforces Round 895 (Div. 3)

Raunit Verma- inCodeforces

You are given 3 integers — 𝑛 , 𝑥 , 𝑦 . Let's call the score of a permutation† 𝑝1,…,𝑝𝑛 the following value: (𝑝1⋅𝑥+𝑝2⋅𝑥+…+𝑝⌊𝑛𝑥⌋⋅𝑥)−(𝑝1⋅𝑦+𝑝2⋅𝑦+…+𝑝⌊𝑛𝑦⌋⋅𝑦) In other words, the score of a permutation is the sum of 𝑝𝑖 for all indices 𝑖 divisible by 𝑥 , minus the sum of 𝑝𝑖 for all indices 𝑖 divisible by 𝑦 . You need to find the maximum possible score among all permutations of length 𝑛 . For example, if 𝑛=7 , 𝑥=2 , 𝑦=3 , the maximum score is achieved by the permutation [2,6⎯⎯,1⎯⎯,7⎯⎯,5,4⎯⎯⎯⎯,3] and is equal to (6+7+4)−(1+4)=17−5=12 .

CreateBlog Picture

A. Reverse a Substring | Codeforces Solution | Educational Codeforces Round 63 (Rated for Div. 2)

Raunit Verma- inCodeforces

You are given a string 𝑠 consisting of 𝑛 lowercase Latin letters. Let's define a substring as a contiguous subsegment of a string. For example, "acab" is a substring of "abacaba" (it starts in position 3 and ends in position 6 ), but "aa" or "d" aren't substrings of this string. So the substring of the string 𝑠 from position 𝑙 to position 𝑟 is 𝑠[𝑙;𝑟]=𝑠𝑙𝑠𝑙+1…𝑠𝑟 . You have to choose exactly one of the substrings of the given string and reverse it (i. e. make 𝑠[𝑙;𝑟]=𝑠𝑟𝑠𝑟−1…𝑠𝑙 ) to obtain a string that is less lexicographically. Note that it is not necessary to obtain the minimum possible string.

CodingKaro App Poster
CodingKaro App
4.7

3K+ Downloads

One of its unique features is an automated coding contest reminder, which sets alarms for upcoming coding contests on popular platforms like CodeChef, CodeForces, and LeetCode, without the need for user input. This feature ensures that users never miss a coding contest and can stay updated with the latest coding challenges.

Download CodingKaro AppDownload CodingKaro App