Prabhdeep Singh has Published 197 Articles

How to reset or clear a form using JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 06-Sep-2023 22:09:50

36K+ Views

This tutorial teaches us how to reset or clear a form using JavaScript. This option is very helpful for users in the situation where they have filled the wrong form and before submitting they get to know about it and now they want to delete all the data. If the ... Read More

Sort 1 to N by swapping adjacent elements

Prabhdeep Singh

Prabhdeep Singh

Updated on 01-Sep-2023 10:15:24

167 Views

An array is a linear data structure that stores the elements and a sorted array contains all the elements in increasing order. Sorting an array by swapping the adjacent elements means we can swap the adjacent elements any number of times and we have to sort the array. We will ... Read More

Numbers having difference with digit sum more than s

Prabhdeep Singh

Prabhdeep Singh

Updated on 01-Sep-2023 10:04:48

165 Views

The digit sum for a given number is the sum of all the digits present in the given number. We will be given a number n and s and we have to find all the numbers which are in the range 1 to n and have the difference between the ... Read More

Back-Face Detection Method

Prabhdeep Singh

Prabhdeep Singh

Updated on 01-Sep-2023 09:54:53

2K+ Views

Programming languages are used for many purposes such as making websites, developing mobile applications, etc. Graphic designing is one of the things that we can do by using the programming language. While graphic designing, we can face a problem where we have to project a 3-D object on the 2-D ... Read More

Largest number in [2, 3, .. n] which is co-prime with numbers in [2, 3, .. m]

Prabhdeep Singh

Prabhdeep Singh

Updated on 01-Sep-2023 09:49:52

48 Views

Co-prime numbers are numbers that do not have any common divisor other than 1. We will be given two numbers n and m. We have to find the largest number in the range of 2 to n (both inclusive) which is co-prime with all the elements in the range of ... Read More

P – smooth numbers in given ranges

Prabhdeep Singh

Prabhdeep Singh

Updated on 01-Sep-2023 09:46:40

64 Views

P smooth numbers are the numbers that have the maximum prime number that can divide them is less than or equal to the given number P. Prime numbers are the numbers that are divisible by only 1 and that number. 1 is by default considered as the P - smooth ... Read More

Minimize the last remaining element of the Array by selecting pairs such that arr[i] >= arr[j] and replace arr[i] with arr[i] – arr[j]

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:20:15

45 Views

We are given an array of non-negative integers and we have to perform an operation of the given array any number of times possible so that we can choose any element of the array and can choose another element from the array that will be less than or equal to ... Read More

Count of triplets in Binary String such that Bitwise AND of S[i], S[j] and S[j], S[k] are same

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:06:32

58 Views

A binary string is a type of string which contains only binary characters that are '0' and '1'. We are given a binary string and have to find the triplets that fulfill the condition that the bitwise 'AND' of the first two characters is equal to the bitwise 'AND' ... Read More

Maximum distance between Peaks in the given Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:05:11

54 Views

A linked list is a linear data structure that stores the data in the nodes and each node contains the address of the next node to make the connection. A peak or the peak node is the node that is not present at the first or the last place and ... Read More

C++ Program to Find Mth element after K Right Rotations of an Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:03:45

50 Views

Right Rotations means we have to shift each element towards the right as the 0th index element shift to the 1st index, the 1st index element shift to the 2nd index, ..., and the last element shift to the 0th index. Here we have given an array of integers of ... Read More

1 2 3 4 5 ... 20 Next
Advertisements