Alshifa Hasnain has Published 283 Articles

Java Program to find Product of unique prime factors of a number

Alshifa Hasnain

Alshifa Hasnain

Updated on 23-Dec-2024 18:10:06

634 Views

In this article, we will learn to calculate the product of the unique prime factors of a given number using Java. Prime factorization plays a crucial role in many mathematical and computational problems, and understanding how to work with prime factors can help you solve complex challenges efficiently.  Problem Statement ... Read More

Java Program for GCD of more than two (or array) numbers

Alshifa Hasnain

Alshifa Hasnain

Updated on 23-Dec-2024 18:08:05

619 Views

In this article, we will learn to calculate the GCD of more than two numbers in Java. We will discuss two approaches, the recursive method and an optimized approach using the Euclidean algorithm. The Greatest Common Divisor (GCD) of two or more integers is the largest integer that divides all ... Read More

JavaScript Submit textbox on pressing ENTER?

Alshifa Hasnain

Alshifa Hasnain

Updated on 23-Dec-2024 18:07:02

3K+ Views

In this article, we will learn to Submit a textbox by pressing ENTER in JavaScript. Submitting a textbox form by pressing the ENTER key is a common requirement in web development, enhancing the user experience by making interactions smoother and more intuitive. Why Enable Form Submission on ENTER Key ... Read More

JavaScript Regex to remove text after a comma and the following word?

Alshifa Hasnain

Alshifa Hasnain

Updated on 23-Dec-2024 11:18:14

735 Views

When working with strings in JavaScript, you might encounter scenarios where you need to clean or format text by removing specific portions. A common task is to remove text after a comma and the following word. This can be achieved efficiently using JavaScript Regular Expressions (Regex). In this article, we’ll ... Read More

JavaScript Program to Check horizontal and vertical symmetry in binary matrix

Alshifa Hasnain

Alshifa Hasnain

Updated on 20-Dec-2024 11:33:30

489 Views

In this article, we will learn to create a program to check both horizontal and vertical symmetry in a binary matrix in JavaScript. A binary matrix is a 2-D array that consists of one and zero only as the elements in each cell. Horizontal symmetry of a binary matrix means ... Read More

Java Regex to extract maximum numeric value from a string

Alshifa Hasnain

Alshifa Hasnain

Updated on 20-Dec-2024 11:33:02

675 Views

In this article, we will learn to extract the maximum numeric value from a string using Java’s regex. While Java provides several ways to handle string manipulation, regular expressions (regex) offer a powerful and efficient tool for such tasks. Problem Statement  The maximum numeric value is extracted from an alphanumeric ... Read More

Java program to find all close matches of input string from a list

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Dec-2024 03:34:20

730 Views

Finding close matches to a string from a list of words is a common problem in string manipulation and pattern recognition. This article demonstrates two effective approaches for solving this problem in Java. The first approach utilizes string encoding to identify similar patterns, while the second approach leverages the Levenshtein ... Read More

Java Program for Minimum Rotations Required to Get the same String

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Dec-2024 03:33:40

346 Views

In this article, we will learn to count the total number of minimum required rotations to get the original string in Java. We can solve the problem by getting the rotations substrings of the original string or concatenating the original string to itself.  Problem statement We have given string str ... Read More

Java program to check whether a given string is Heterogram or not

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Dec-2024 03:31:34

495 Views

A heterogram is a string where each letter appears only once, with no repeated characters. This property makes it unique and an interesting problem to solve in Java. In this article, we will learn to determine whether a given string is a heterogram using a frequency-based approach and introduce an ... Read More

Java Program for Pigeonhole Sort

Alshifa Hasnain

Alshifa Hasnain

Updated on 13-Dec-2024 21:50:47

445 Views

In this article, we will learn Pigeonhole Sort in Java, a sorting algorithm designed for arrays with a small range of integer values. It organizes elements into "pigeonholes" based on their values and then reconstructs the sorted array. We’ll discuss two approaches: a basic method using arrays and an optimized ... Read More

Advertisements