Avinash Gupta

Avinash Gupta

5 Articles Published

Articles by Avinash Gupta

5 articles

Frequency Measuring Techniques for Competitive Programming

Avinash Gupta
Avinash Gupta
Updated on 28-Aug-2023 357 Views

In this article, we are going to find the different ways to find the frequency of numbers present in an array []. These methods are very useful in doing competitive programming for different problems for different cases. Sometimes, calculating the frequency of elements whether it is numbers or alphabets presented in the array is a complicated task. Various algorithms like Searching, array, divide and conquer can be used to find the repeated elements defined in the array. Note- Take an integer array. Let's explore the article, to know how it can be solved by using Java programming ...

Read More

Find Words which are Greater than given Length k using Stringstream

Avinash Gupta
Avinash Gupta
Updated on 23-Aug-2023 302 Views

This is the problem based on stringstream class present in C++ “sstream” header file. Here, we have to find those strings whose lengths are greater than “k”. This task will be performed by using stringstream class. The concept is to partition the string and then iterate through the defined words. The value of length k has to be specified to obtain the words which are larger than k whereas the length of the words which are smaller than k will not be displayed in the output. In this article, we will understand how to find words which are greater than ...

Read More

Length of Longest Common Subsequence Containing Vowels

Avinash Gupta
Avinash Gupta
Updated on 23-Aug-2023 384 Views

In this problem, our task is to find the length of the longest possible subsequence present in two strings such that every letter of the subsequence must be a vowel. With the help of the recursive algorithm and iterative algorithm, the given problem statement can be solved. In English Alphabet, there exist five vowels named 'A', 'E', 'I', 'O', 'U'. Subsequence Vs. Substring: In Subsequence, we may take characters in a non-continuous way, but in Substring, we can take only continuous characters. Ex: In String “TutorialsPoint”: “tri” is a subsequence but not a substring. While “tor” is both subsequence ...

Read More

Remove Duplicates from a String in O(1) Extra Space

Avinash Gupta
Avinash Gupta
Updated on 23-Aug-2023 481 Views

In this problem, our task is to remove all the duplicate characters present in the string other than the first occurrence of every character. Also, it's required to solve the problem without using any extra space, and the Space complexity must be O(1). Various approaches are used in this article. The Boolean array is defined in one approach to determine the repetition of the characters where the index of Boolean array is mapped to each alphabet. In the second approach, the concept of the Bit manipulation is used to remove the repeated characters from the resultant string. Let's explore ...

Read More

Sort Elements on the basis of the Number of Factors

Avinash Gupta
Avinash Gupta
Updated on 23-Aug-2023 791 Views

In this problem, our task is to sort the array of integers based on several factors of numbers present in the array as a priority. The array is the best way to store similar types of elements in java. But if the number of factors becomes equal in any two numbers, then as a second priority, this algorithm sees numerical value. Factors are the numbers by which the given number is divisible entirely without leaving any remainder. This article uses various approaches to sort elements based on several factors. To show you some instances Instance-1 If Array = ...

Read More
Showing 1–5 of 5 articles
« Prev 1 Next »
Advertisements