Prabhdeep Singh has Published 197 Articles

Next greater number on the basis of the precedence of digits

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:33:02

65 Views

In the normal number system, 0 is the smallest digit while 9 is the largest digit. In this problem, we will be given a list of the length 10, and starting from index 0 to index 9 it represents a digit, which indicates the priority of that digit and the ... Read More

Check if the given String can be split only into subsequences ABC

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:28:41

114 Views

A subsequence of a string means part of a string in which characters can be taken from anywhere of the string (zero or more elements) without changing the order of the characters and forming a new string. In this problem, we have given a string of length N where every ... Read More

Check if the Decimal representation of the given Binary String is divisible by K or not

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 12:36:08

280 Views

A binary string is a string that consists of only two different types of characters and that is ‘0’ and ‘1’, hare base is 2. And a decimal representation means each digit is lie between ‘0’ to ‘9’, here the base is 10. Here we have given a string of ... Read More

Maximize the sum of selected numbers from an array to make it empty

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 12:31:26

123 Views

We will be given an array and have to choose an element from it and add that element to the sum. After adding that element to the sum, we have to remove three elements from the array if they exist current number, current number -1, and current number + 1. ... Read More

JavaScript Program To Add Two Numbers Represented By Linked Lists- Set 1

Prabhdeep Singh

Prabhdeep Singh

Updated on 04-May-2023 11:02:09

131 Views

Adding two numbers is an easy task but could be tricky if the numbers are given in the form of the linked list. Each node of the linked list contains the digit of the number it represents in a continuous manner from the first node to the last node. We ... Read More

JavaScript Program to Check if strings are rotations of each other or not

Prabhdeep Singh

Prabhdeep Singh

Updated on 04-May-2023 11:00:13

323 Views

Strings are rotations of each other means two strings that can be rotated to either the right or left direction to obtain the other string. In the right rotation characters of the string shift to their following index and for the zeroth index, it takes the character of the last ... Read More

JavaScript Program for Writing A Function To Get Nth Node In A Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 04-May-2023 10:58:19

59 Views

Linked list is a linear data structure and all the nodes are connected to each other by storing the address of the next node. To find the nth node in a linked list means to get the value present at the nth node of the given linked list and that ... Read More

JavaScript Program for Check if an array is sorted and rotated

Prabhdeep Singh

Prabhdeep Singh

Updated on 21-Apr-2023 09:16:19

153 Views

A sorted array is an array where all the elements are present in increasing order. We have given an array of size N and an array containing the distinct integers (which means every integer is present only one time). We have to check the array is sorted and rotated in ... Read More

JavaScript Program for Ceiling in a sorted array

Prabhdeep Singh

Prabhdeep Singh

Updated on 21-Apr-2023 09:10:43

127 Views

An array is a linear data structure that contains the objects and in sorted array elements are present in increasing order. We have given a sorted array and an integer x. We have to print the ceiling of the integer x from the given array. The ceiling of a sorted ... Read More

JavaScript Program for Block swap algorithm for array rotation

Prabhdeep Singh

Prabhdeep Singh

Updated on 20-Apr-2023 17:22:31

134 Views

Rotation of the array elements means moving the elements of the given array to either the left or right side by some number of specific positions. We will assume the array in the cyclic form and rotate the elements of the edges to the other end. Block swap algorithm for ... Read More

Advertisements