Prabhdeep Singh has Published 188 Articles

JavaScript Program for Products of ranges in an array

Prabhdeep Singh

Prabhdeep Singh

Updated on 04-Dec-2024 22:05:47

221 Views

We will be given an array and we have to answer some queries related to the given range that is from a given starting index to the ending point or index we have to return the product of the elements in that range. We will see some approaches in this ... Read More

Java program to find longest common prefix using word by word matching

Prabhdeep Singh

Prabhdeep Singh

Updated on 29-Sep-2024 02:50:52

916 Views

In this article, we will explore how to find the longest common prefix among a given set of strings using two different approaches in Java. We will first discuss an approach that compares all strings directly to find the longest prefix and then move to a word-by-word matching approach.  Problem ... Read More

Java Program To Write Your Own atoi()

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-Aug-2024 08:02:41

862 Views

The atoi() function is used in C programming language and used to convert the string which is passed as the parameter to it into an integer value if the string is a valid integer otherwise it shows the undefined behavior. We will implement the atoi() function in the Java programming ... Read More

Java program to find length of the longest substring without repeating characters

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Jul-2024 11:43:39

2K+ Views

In Java, substrings are part of the string which contains the continuous character of the string of any length from 1 to complete string. We are given a string and we have to find the length of the largest substring from the given string that only contains the unique characters. ... Read More

How to reset or clear a form using JavaScript?

Prabhdeep Singh

Prabhdeep Singh

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

44K+ 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

399 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

276 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

7K+ 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

152 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

310 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

Advertisements