AYUSH MISHRA has Published 134 Articles

Kth largest Element in a 2D matrix where each row and column is sorted in C++

AYUSH MISHRA

AYUSH MISHRA

Updated on 24-Apr-2025 10:33:13

731 Views

Finding the Kth largest element in a 2D matrix where each row and column is sorted is a common problem in computer science. This problem has many real-life applications, such as a ranking system, where we need to find the Kth highest score in a sorted dataset. In this article, ... Read More

Swap all odd and even bits using C++

AYUSH MISHRA

AYUSH MISHRA

Updated on 22-Apr-2025 15:11:28

4K+ Views

We can swap all odd and even bits in a given integer. Swapping of odd and even bits means changing the bits present at odd positions with the bits at even positions in a binary representation of a number. One real-life application is optimizing data storage or modifying data patterns ... Read More

Maximum Subarray Sum - Kadane Algorithm using C#

AYUSH MISHRA

AYUSH MISHRA

Updated on 21-Apr-2025 14:40:12

3K+ Views

In this problem, we are given an array of integers that may contain both positive and negative integers. We have to calculate the maximum sum of any contiguous subarray of the given array. In this article, we are going to learn how we can find the maximum subarray sum using ... Read More

JavaScript program to remove vowels from a string

AYUSH MISHRA

AYUSH MISHRA

Updated on 21-Apr-2025 14:23:27

611 Views

A string is a sequence of characters that can include alphabets, numbers, and symbols together or separately. In this article, we are going to learn how we can remove vowels from a given string in JavaScript using different approaches. There are a total of five vowels in the English alphabet. ... Read More

C Program to Find if there is any subarray with a sum equal to 0

C
AYUSH MISHRA

AYUSH MISHRA

Updated on 17-Apr-2025 15:42:28

271 Views

What is a Subarray? A subarray is a contiguous part of the array. The sum of elements in a subarray is the cumulative sum of elements of a subarray. For example: in the given array [1, 2, 3, 4, 5, 6] the subarray is [3, 4, 5]. In this article, ... Read More

Program to Rotate a matrix by 90 degrees in the clockwise direction in C

C
AYUSH MISHRA

AYUSH MISHRA

Updated on 17-Apr-2025 13:29:28

3K+ Views

In this article, we are given an N x N matrix, and our task is to rotate it by 90 degrees clockwise in C. Example Input: [1 2 3], [4 5 6], [7 8 9] Output: [7 4 1], [8 5 2], [9 6 3] Below are different ... Read More

Check if all the 1s in a binary string are equidistant or not in C++

AYUSH MISHRA

AYUSH MISHRA

Updated on 14-Apr-2025 12:40:11

112 Views

In this problem, we are given a binary string, and we have to check if all the 1s present in the binary string are at an equivalent distance from each other. Example 1 Input: binaryString = "10101010" Output: Yes ... Read More

C++ program for finding nth term of H.P.

AYUSH MISHRA

AYUSH MISHRA

Updated on 09-Apr-2025 18:56:09

3K+ Views

What is Harmonic Progression? A Harmonic Progression is a sequence of numbers formed by the reciprocal of an Arithmetic progression sequence. If a given sequence a1, a2, a3, a4... is in Arithmetic progression, then 1/a1, 1/a2, 1/a3, 1/a4... forms a Harmonic Progression. Formula for the ... Read More

PHP Program to Calculate the Average of an Array of Numbers

AYUSH MISHRA

AYUSH MISHRA

Updated on 28-Mar-2025 16:24:33

500 Views

The average or mean of an array is a basic mathematical operation in programming. The average is used in analytics, finance, and reporting. One of the real-life applications is a website that calculates the average rating of a product or the average score of a test. In this article, we ... Read More

Python Program to Rearrange an array such that arr[i] = i

AYUSH MISHRA

AYUSH MISHRA

Updated on 27-Mar-2025 19:41:16

1K+ Views

In this problem, we are given an array and we have to rearrange the elements of the array such that for each index i, arr[i] = i. We have to rearrange the elements so that each element is in the position corresponding to its value. Scenario 1 Input: [3, 0, ... Read More

Advertisements