Vinay Singh

I am a Full Stack Developer with a Bachelor's Degree in Computer Science, who also loves to write technical articles that can help fellow developers.

Author Archives: Vinay Singh

Top 10 Real-World Python Applications That You Should Know

We live in a world where people and businesses rely highly on software applications to accomplish a variety of tasks. Every industry vertical leverages various software applications to automate their manual tasks, from education and healthcare to government and military. As a result, the software development industry is booming at a high rate. A galore of programming languages… Read More »

Left Rotate an Array

Problem Given an array of integers, you need to rotate it by k times. Sample Input [1, 2, 3] k=1 Sample Output [2, 3, 1] Approach 1 We can place the first k elements in some other array and shift remaining elements to the beginning. Later, we can insert the first k elements at the last. The approach… Read More »

Python vs Go – Which One to Choose in 2022?

A programming language is the heart of the development process since it can make or break a project. However, programmers often get confused in choosing the right programming language for their projects. Many developers struggle to make a choice between Python and Go as both are among the most prominent programming languages. However, these programming languages are dissimilar.… Read More »

Pycharm vs VS Code: Which One is the Best?

PyCharm is a dedicated Python IDE (Integrated Development Environment) developed by JetBrains. It combines multiple development tools, such as a source-code editor, graphical debugger, test runner, and Python profiler, and provides them under a single application. Also, it tightly integrates with other tools such as scientific tools, databases, and Python web frameworks. Visual Studio Code (VS Code) by… Read More »

Monotonic Array

Problem Given an array. Check if it is monotonic increasing or decreasing. An array is monotonic increasing if for all i<=j, a[i]<=a[j]. An array is monotonic decreasing if for all i<=j, a[i]>=a[j] Sample Input 1 2 2 Sample Output True Explanation 1 <= 2 <= 2 for indexes 0 < 1 < 2 Approach We can initialize two… Read More »

Binary Gap

Problem Given an integer ‘n’, find the maximum gap between two occurrences of 1. If no or only 1 exists in the binary representation, return 0. Sample Input 6 Sample Output 1 Explanation The binary of 6 is ‘110’ and the maximum gap between two 1s is 1. Approach We create a ‘count’ variable to count the number… Read More »

Arranging coins

Problem We’ve been given ‘n’ coins, and you’re supposed to use them to build a staircase. The staircase is made up of a certain number of rows, with the ‘ith’ row containing exactly ‘i’ coins. The last row of the staircase may not have all the required coins Return the number of complete rows of the staircase you… Read More »

Maximum Units

Problem You have to place some amount of boxes into the truck. You are given a 2D array where each element represents the number of boxes of type ‘i’ and number of units in the box of type ‘i’ respectively. You are also given an integer, which is the maximum number of boxes that can be put on… Read More »

Missing Numbers

Problem Given an integer array in which all numbers occur twice except 2. Find those two numbers. Sample Input 1, 2, 2, 3, 4, 4 Sample Output 1 3 Explanation 1 and 3 occur once Approach Let’s look at some properties of XOR: a ⊕ b = b ⊕ a and a ⊕ (b ⊕ c) = (a… Read More »