Prateek Jangid has Published 165 Articles

Repeated Unit Divisibility using C++

Prateek Jangid

Prateek Jangid

Updated on 29-Nov-2021 09:52:43

250 Views

In this article, we will discuss finding the number of repeated units divisible by N. Repeated units are the repetitive numbers of 1 only, Let R(k) be the repetitive unit where k is the length of 1’s. E.g R(4) = 1111. So we need to find the minimum number of ... Read More

Removing Elements Between the Two Zeros using C++

Prateek Jangid

Prateek Jangid

Updated on 29-Nov-2021 09:48:57

187 Views

In this article, we will discuss how to remove elements between two zeros from a given string that contains only zero’s and one’s character. The final string should not contain any character ‘1’ surrounded by 0’s. For example −Input : string = “110010” Output : “11000” Explanation: 1 is found ... Read More

Remove repeated digits in a given number using C++

Prateek Jangid

Prateek Jangid

Updated on 29-Nov-2021 09:44:27

621 Views

In this article, we are given a number n, and we need to remove repeated digits in a given number.Input: x = 12224 Output: 124 Input: x = 124422 Output: 1242 Input: x = 11332 Output: 132In the given problem, we will go through all the digits and ... Read More

Remove Leading Zeros from an Array using C++

Prateek Jangid

Prateek Jangid

Updated on 29-Nov-2021 09:42:10

877 Views

We are provided an array, and we are tasked to remove the leading zeros from the given array and then print the array.Input : arr[] = {0, 0, 0, 1, 2, 3} Output : 1 2 3 Input : arr[] = {0, 0, 0, 1, 0, 2, 3} Output ... Read More

Remove Last Node of the Linked List using C++

Prateek Jangid

Prateek Jangid

Updated on 29-Nov-2021 09:36:35

266 Views

We are provided with a singly linked list, and we are tasked to remove the last node from that list. In this problem, we are simply going to traverse through the given list and simply remove the last node.Approach to find The SolutionIn this approach, we go through the given ... Read More

Remove First Node of the Linked List using C++

Prateek Jangid

Prateek Jangid

Updated on 26-Nov-2021 11:18:33

325 Views

Given a linked list, we need to remove its first element and return the pointer to the head of the new list.Input : 1 -> 2 -> 3 -> 4 -> 5 -> NULL Output : 2 -> 3 -> 4 -> 5 -> NULL Input : 2 -> ... Read More

Remove Every K-th Node Of The Linked List

Prateek Jangid

Prateek Jangid

Updated on 26-Nov-2021 11:12:25

605 Views

In this article, we will explain the way to remove every k-th node of the linked list. We must delete every node that sits on the multiple of k, i.e., we have to delete the node on positions k, 2*k, 3*k, etc.Input : 112->231->31->41->54->63->71->85    k = 3 Output : ... Read More

Rearrange an Array to Maximize i*arr[i] using C++

Prateek Jangid

Prateek Jangid

Updated on 26-Nov-2021 10:41:11

990 Views

In this article, we will discuss the problem of rearranging a given array of n numbers. Basically, we have to select elements from the array. For selecting each element, we get some points that will be evaluated by the value of the current element * a number of elements selected ... Read More

Rearrange An Array In Order – Smallest, Largest, 2nd Smallest, 2nd Largest,. Using C++

Prateek Jangid

Prateek Jangid

Updated on 26-Nov-2021 10:32:44

865 Views

We are given an array; we need to arrange this array in an order that the first element should be a minimum element, the second element should be a maximum element, the third element should be 2nd minimum element, the fourth element should be the 2nd maximum element and so ... Read More

Rearrange an Array in Maximum Minimum Form using C++

Prateek Jangid

Prateek Jangid

Updated on 26-Nov-2021 10:26:52

374 Views

We are given a sorted array. We need to arrange this array in maximum, minimum form, i.e., the first element is the maximum element, the second element is the minimum element, the third element is 2nd maximum element, the fourth element is 2nd minimum element, and so on, for example ... Read More

Previous 1 ... 5 6 7 8 9 ... 17 Next
Advertisements