Prabhdeep Singh has Published 188 Articles

Fibbinary Numbers (No consecutive 1s in binary) – O(1) Approach

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:35:03

350 Views

Fibbinary Numbers are numbers that have no consecutive 1s in their binary representation. However, they can have consecutive zeros in their binary representation. Binary representation is the representation in which the numbers are shown with base 2 and only two digits that are 1 and 0 only. Here, we will ... Read More

Next greater number on the basis of the precedence of digits

Prabhdeep Singh

Prabhdeep Singh

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

152 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

265 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

594 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

195 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

262 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 for Writing A Function To Get Nth Node In A Linked List

Prabhdeep Singh

Prabhdeep Singh

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

200 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

290 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

211 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 to Check If a Singly Linked List is Palindrome

Prabhdeep Singh

Prabhdeep Singh

Updated on 20-Apr-2023 17:19:55

303 Views

A singly linked list is a linear data structure that is stored in a non-contiguous way in the memory and each block is connected by holding the address of the next block also known as a node. A palindrome can be explained as a set of characters, digits, etc, and ... Read More

Advertisements