Introduction In medieval times, mighty rulers would expand their kingdoms by using a principle called divide and conquer. But have you ever wondered why their methods were so effective? It was because dividing a large territory into smaller ones and ...

Introduction Almost everyone enjoys a tasty slice of cake every now and then, but have you ever thought of baking one? To bake a cake, we will first need a recipe. In this recipe, the proper measurements of each ingredient ...

Introduction The scanf() function is a widely used function in C/C++. Although the syntax to use it is simple, it is important to understand some areas where its usage would require careful handling. One such area is when fgets() is ...

Introduction Prime Factorisation Method is the method used to represent any number as the product of all prime factors of a given number. Prime numbers mean numbers with only two factors, one and the number itself. For example, numbers such ...

Introduction Fibonacci series of numbers is a series of numbers formed by the addition of the preceding two numbers. The term ‘Fibonacci’ for such a sequence of numbers was coined in the 12th century by Leonardo Fibonacci, who was stumbled ...

Introduction A frequently asked question by Amazon, Paytm, and many other Product based companies is Subarray with given sum, “Given an unsorted array of integers, and an integer k. The task is to find whether there exists a subarray(positive length) ...

Introduction Countless times, we have heard our Maths teachers specify different methods for solving a particular problem. The goal is to use short and easy techniques instead of lengthy, complicated ones. Likewise, while writing code, it is a good practice ...

Introduction “The most effective techniques are those that are simple and well-executed,” in Data Structures and Algorithms, the two pointer technique is one of them. Two Pointers is a pattern in which two pointers iterate across the data structure until ...

Introduction The Fibonacci sequence is a sequence in which each number is the sum of the preceding two numbers. By default, the first two numbers of a Fibonacci series are 0 and 1. In mathematical terms, the sequence Fn of ...

Introduction Reversing a string is an important problem that is famous across many competitive coding problem banks. Before that, what is a string? A string is a set of characters stored in an array, or we can also define it ...