Found 9321 Articles for Object Oriented Programming

Common Character Count in Strings in JavaScript

Nikitasha Shrivastava
Updated on 14-Aug-2023 14:03:19

457 Views

In the given problem statement we are required to find the common characters count for the given strings with the help of Javascript functionalities. So we will use basic Javascript to solve this problem. Understanding the problem The problem at hand is to find the common characters between the two given strings. So for solving this problem we will determine how many characters they have in common. For example suppose we have two strings like "abaac" and "baaaa" so in these two strings we can see there are 2 common characters which are 'a' and 'b'. So the ... Read More

Getting century from year in JavaScript

Nikitasha Shrivastava
Updated on 14-Aug-2023 18:04:31

2K+ Views

In the given problem statement we are required to get the century from the given year with the help of Javascript functionalities. So we will use the basic functions of Javascript to solve this problem. Understanding the Problem The problem at hand is to find the century number of the given input year. So basically we have to create an algorithm for finding the century number corresponding to the given year. So first understand what the century number is! A century represents a period of 100 years, beginning from the year 1. For example, the 20th century ... Read More

JavaScript - Find if string is a palindrome (Check for punctuation)

Nikitasha Shrivastava
Updated on 14-Aug-2023 18:29:04

496 Views

In the given problem statement we have to find that the string is a palindrome and the string should also have punctuation and write code with the help of Javascript functionalities. Understanding the problem The problem at hand is to explore how to determine whether a given string is a palindrome or not with the help of Javascript. So let's see what palindrome is first. A palindrome is a word, phrase, a number or a sequence of letters which can be read the same forward and backward. For example: racecar is a palindrome string. Logic ... Read More

Maximum sum of n consecutive elements of array in JavaScript

Nikitasha Shrivastava
Updated on 16-Aug-2023 12:23:07

667 Views

In the given problem statement our aim is to find the maximum sum of n consecutive items of array with the help of Javascript functionalities. So for solving this problem we will use basic Javascript functionalities and produce the maximum sum. Understanding the Problem The problem at hand is to find the maximum sum of n consecutive items in the array. This process will involve identifying a continuous subarray of length n within the given array which has the highest possible sum. For example suppose we have an array as [1, 2, 4, 7, 3, 5] so that ... Read More

How to shift each letter in the given string N places down in the alphabet in JavaScript?

Nikitasha Shrivastava
Updated on 14-Aug-2023 18:22:04

1K+ Views

In the given problem statement our aim is to shift every letter in the given string N places down in the alphabet with the help of Javascript functionalities. So we will use some basic Javascript methods to complete the given task. Understanding the Problem The problem at hand is to shift the character of the given string up to the N places down in the alphabets with the help of Javascript. The purpose of this problem is we need to take a string as input and we have to update the given string by shifting every letter N ... Read More

How to get almost increasing sequence of integers in JavaScript ?

Nikitasha Shrivastava
Updated on 14-Aug-2023 18:16:56

309 Views

In the given problem statement we have to get an almost increasing sequence of integers with the help of Javascript functionalities. So we will use some basic functionalities of mathematics and Javascript. Understanding the problem The problem at hand is to generate an almost increasing series of integers in Javascript. So the almost increasing sequence is a sequence in which every item is greater than or equal to the previous item. In other terms we will say it allows for a single item in the sequence where an item is smaller than the previous item. So the resultant ... Read More

Finding the nth prime number in JavaScript

Nikitasha Shrivastava
Updated on 14-Aug-2023 17:48:50

4K+ Views

In the given problem statement our task is to find the nth prime number with the help of Javascript functionalities. So we will use two functions to solve this problem. Understanding the Problem The problem at hand is to find the nth prime number using the Javascript programming. So the prime number is a positive integer number which is greater than 1 and which has no positive divisors other than 1 and the number itself. The task is to create a Javascript function which takes an input n. Here n represents the position of the prime number which ... Read More

Smallest number that is divisible by first n numbers in JavaScript

Nikitasha Shrivastava
Updated on 16-Aug-2023 16:52:33

189 Views

In the above problem statement our task is to find the smallest number that is divisible by the first n numbers with the help of Javascript functionalities. So Understanding the Problem The problem at hand is to find the smallest number which is evenly divisible by the first n numbers. Or we can say that we have to look for a lowest number that can be divided by each of the numbers from 1 to n without any remainder. Logic for the given Problem For solving this problem we can use the concept of Least ... Read More

Find the largest palindrome number made from the product of two n digit numbers in JavaScript

Nikitasha Shrivastava
Updated on 14-Aug-2023 17:25:08

214 Views

In the given problem statement we have to find the largest palindrome number made from the product of two n digit numbers with the help of Javascript functionalities. So we will create two functions to do this task. First function is to find the largest palindrome number and the second function is to check that the number is palindrome. What are Palindrome Numbers ? In the given problem statement there is the usage of the word palindrome !! Let’s first understand the meaning of this word. Palindrome is the term used when we have to define a string ... Read More

Finding the largest prime factor of a number in JavaScript

Nikitasha Shrivastava
Updated on 14-Aug-2023 17:45:04

716 Views

In the given problem statement we have to find the largest prime factor of a number with the help of Javascript functionalities. So we will solve this problem with the help of basic functionalities of Javascript. Understanding the Problem The problem at hand is to find the largest prime factor of a given input number. So the prime factor of a number is the prime number which can divide the given number without leaving the remainder. Our task is to find the largest prime factor which is the prime factor with the highest value. For example let's say ... Read More

Advertisements