Thanweera Nourin A V has Published 32 Articles

C++ Program to Find Lexicographically minimum string rotation

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 30-Oct-2023 15:54:20

58 Views

The aim of this article is to implement a C++ Program to Find Lexicographically minimum string rotation. Coming on to the definition of string, a string is a group of characters that ends with the null character "0" in C programming. Characters from the C String are kept in a ... Read More

Check if given String is K-periodic for all K in range [1, N]

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 30-Oct-2023 15:14:19

73 Views

The aim of this article is to implement a program to check if a given String is K-periodic for all K in range [1, N]. The aim is to determine whether the supplied string is K-periodic provided the string s and the integer K. If a string repeats the sub-string ... Read More

Check for Amicable Pair

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:53:26

1K+ Views

The concept of an amicable pair of numbers or a friendly pair of numbers seems interesting right? So what exactly are amicable pairs of numbers? Two numbers are said to be an amicable pair of numbers only if the sum of the first number's proper divisors equals the sum ... Read More

Sophie Germain Prime

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:51:25

101 Views

Prime numbers are those numbers that are greater than one and they simply have two factors: the number itself and factor 1. This indicates that no number apart from 1 as well as the number itself could be used to divide these numbers without leaving a residue. For instance, the ... Read More

Stern-Brocot Sequence

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:46:56

171 Views

The aim of this article is to implement a program to print the Stern-Brocot sequence. What is the Stern-Brocot sequence? Stern-Brocot sequence, which is also known as Stern’s diatomic series, is a sequence of numbers generated as given below. 1, 1, 2, 1, 3, 2, 3, 1, ... Read More

Maximise consecutive steps one can put forward on roof to gain an increase in altitude

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:45:38

42 Views

In this article our aim is to determine the most steps one can take in a row, provided the heights of the adjacent buildings, to gain altitude as he moves in from roof of one to the roof of the adjacent building. That is building heights for each one after ... Read More

Program to find Simple Moving Average

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:42:52

1K+ Views

In this article, our aim is to determine the Simple Moving Average of the given values in the array. Let us take a quick glance at what Simple Moving Average means. The average derived from the data over a certain amount of time (t) is known as the simple ... Read More

Making Elements Distinct in a Sorted Array by Minimum Increments

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:41:23

73 Views

The aim of this article here is to make the elements distinct in a sorted array by minimum increments. First, an array of integers that has been sorted is provided. By increasing the values and keeping the array sum as low as possible, we must make array elements discrete from ... Read More

Implement Random-0-6-Generator using the given Random-0-1-Generator

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:40:02

191 Views

In this article, our primary aim is to come up with a solution to implement a random-0-6-Generator using the given random-0-1-Generator. As we know, A random-0-1-Generator() function returns either 0 or 1 as the output. Similarly, a random-0-6-Generator, as the name suggests, gives any random numbers between 0 ... Read More

Program to print Fibonacci Triangle

Thanweera Nourin A V

Thanweera Nourin A V

Updated on 23-Aug-2023 21:38:39

2K+ Views

A Fibonacci series is found in every row of the Fibonacci triangle. What is a fibonacci series? In the Fibonacci series, each digit equals the sum of the two integers before it. This series' first two digits are 1 and 1. The next elements in the series are ... Read More

Advertisements