Found 10711 Articles for Web Development

JavaScript Program for Maximum Product Subarray

Prabhdeep Singh
Updated on 30-Mar-2023 11:44:39

245 Views

A subarray is part of an array formed by removing some or no prefixes of the array and removing some or no suffix elements of the given array. We will try to find the subarray that will contain the elements, and by multiplying all of them, we can get the maximum value. We will implement the code with the explanation. In this article, we will implement a JavaScript program for the Maximum product subarray. Introduction to Problem In this problem, we are given an array and we have to pick any subarray from the given array, but the issue is ... Read More

JavaScript Program for Maximize Elements Using Another Array

Prabhdeep Singh
Updated on 30-Mar-2023 11:42:46

127 Views

In this article, we are going to implement a JavaScript program for Maximizing elements using another array. We are given two arrays and have to pick some elements from the second array and replace the elements of the first array. We will see the complete code to implement the concepts that will be discussed. Introduction to Problem In this problem, we are given two arrays and we have to make all the elements of the first array maximum as possible or simply we have to make the sum of all elements of the first array maximum. We can pick elements ... Read More

JavaScript Program for Markov Matrix

Prabhdeep Singh
Updated on 30-Mar-2023 11:40:36

116 Views

A matrix is a kind of 2-D array, which is in the form of some number of rows, and for each row, there is the same number of columns and by the row and column number, we can get the element at any particular index. For the Markov matrix, each row's sum must equal 1. We are going to implement a code to create a new Markov matrix and find if the currently given matrix is a Markov matrix or not. Introduction to Problem In the given problem, we have to write a code that will produce the Markov ... Read More

JavaScript Program for Longest Subsequence of a Number having Same Left and Right Rotation

Prabhdeep Singh
Updated on 30-Mar-2023 11:37:09

141 Views

We will implement a code to find the longest subsequence of a given number that has the same left and right rotation in the JavaScript programming language. The left and right rotation of a given number means, for left rotation we have to move the left-most digit of the number to the end position or the rightmost position. Similarly, for the right rotation, we have to move the right-most digit of the number to the first position or the leftmost position. We will see the complete code with the implementation. Introduction to Problem In this problem, we are given a ... Read More

JavaScript Program for Left Rotation and Right Rotation of a String

Prabhdeep Singh
Updated on 30-Mar-2023 11:36:01

760 Views

Left rotation of a string means anti-clockwise movement of the given number of characters from the prefix side and add them to the suffix side. Similarly, right rotation of a string means clockwise movement of the characters of the given string but just opposite of the left rotation and given number of characters are picked from the suffix and added to the prefix of the string. In this article, we will implement the JavaScript program for the left rotation and right rotation of a given string. Introduction to Problem In this problem, we are given a string and a number. ... Read More

JavaScript Program for the Least Frequent Element in an Array

Prabhdeep Singh
Updated on 30-Mar-2023 11:33:39

478 Views

In this program, we are given an array of integers or elements and we have to return the element which presents the least numbers of the time in the array, and if there is more than one least frequent number present we can return any one of them which we are going to see in the article below. Introduction to Problem In the given problem we have to find the least frequent element in an array. Here we have given an array with duplicate numbers and here we have to count the occurrence of each element and among all of ... Read More

JavaScript Program for the Last duplicate element in a Sorted Array

Prabhdeep Singh
Updated on 30-Mar-2023 11:31:04

269 Views

In this program, we are given a sorted array with duplicate elements and we have to traverse the for loop and return the index of the last duplicate element present in the array and also the duplicate number, which is going to see in the article below. Introduction to Problem In the given problem we have to find the last duplicate element in a sorted array. Duplicate means the number is present more than one time, so here we have given a sorted array (increasing order) from which we have to find the index of the last duplicate elements and ... Read More

How to add emoji in HTML document?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:45:47

3K+ Views

Emojis are small digital images or icons that are generally used in messaging and other places to express emotions or ideas. In this article, we are going to see how we can add emojis to an HTML document. Approach By setting the charset used to display webpages in the browser to UTF-8, emojis can be added to HTML documents. We can use the tag in the head section to specify this character encoding information. Emojis can be added to HTML after the charset has been declared by utilising the p and span tags. While the emoji is inserted in ... Read More

How to add description list of an element using HTML?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:44:22

180 Views

HTML, which stands for HyperText Markup Language, is a combination of Hypertext and Markup language which we can use to structure a web page and its content. In this article we are going to take a look at how we can add a description list of an element using HTML. tag The tag is used to represent the description list. This tag is used alongside the tags and . Syntax Description List Content Approach We are going to make use of the tag alongside the and tags to add description list of an ... Read More

How to add copyright symbol to your HTML document?

Aayush Mohan Sinha
Updated on 24-Nov-2023 01:44:20

903 Views

HTML, which stands for HyperText Markup Language, is a combination of Hypertext and Markup language which we can use to structure a web page and its content. In this article, we will see how we can add the copyright symbol to our web page. Approach The copyright symbol is not present on the keyboard. Therefore, we must use another method to add this to our webpage. We are going to see three different methods − Using hexadecimal code Using HTML code Using HTML entity Method 1: Using Hexadecimal Code The hexadecimal code for the copyright symbol is © ... Read More

Advertisements