Java Program to find maximum and minimum occurring character in a string.8 Jan 2025 | 3 min read In this program, we need to count each character present in the string and find out the maximum and minimum occurring character. Grass is greener on the other side In above example, character 'a' is occurred only once in the string. So, it is minimum occurring character and is highlighted by red. Character e has occurred maximum number of times in the entire string i.e. 6 times. Hence, it is the maximum occurring character and is highlighted by green. ALGORITHM
Program:Output: Minimum occurring character: a Maximum occurring character: e Next TopicJava Programs |
In this section, we will learn what is a bouncy number and also create Java programs to check if the given number is bouncy. The bouncy number program frequently asked in Java coding tests and academics. Before understanding the bouncy number, first, we will understand what...
4 min read
It is very interesting problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going to...
6 min read
In this section, we will create a Java program to display even numbers from 1 to 100. To learn the Java even number program, you must have the basic knowledge of Java for loop and if statement. We can use different ways to display even numbers: Using Java...
3 min read
In this section, we will discuss what is Armstrong number and also create Java programs to check if the given number is an Armstrong number or not. The Armstrong number program frequently asked in Java coding interviews and academics. Armstrong Number An Armstrong number is a positive...
5 min read
Multiplication of matrix is a core concept in programming. We can perform matrix multiplication in Java using a simple nested for loop approach to advance approach. The nested for loop approach has a time complexity of O(n3). The time complexity of matrix multiplication can be improved...
17 min read
It is a problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going to discuss...
5 min read
Java program to print the following pattern on the console Algorithm: STEP 1: START STEP 2: SET i =1.REPEAT STEP 3 to 7UNTIL i<=10. STEP 3: SET j=1.REPEAT STEP 4 and 5UNTIL j<=10. STEP 4: if(i==0 or i==10 or j==0 or j==10) then PRINT 1 else PRINT "" STEP 5: SET...
1 min read
? Two strings are called anagrams if they contain same set of characters but in different order. "keep ? peek", "Mother In Law - Hitler Woman". File: AnagramString .java import java.util.Arrays; public class AnagramString { static void isAnagram(String str1, String str2) { String s1 = str1.replaceAll("\\s", ""); String s2 = str2.replaceAll("\\s", ""); boolean...
1 min read
In this program, we will create a circular linked list and delete a node from the middle of the list. If the list is empty, display the message "List is empty". If the list is not empty, we will calculate the size of the list...
9 min read
In this program, we will create a doubly linked list then, iterate through the list to find out the minimum and maximum node. We will maintain two variables min and max. Min will hold the minimum value node, and max will hold the maximum value node....
6 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India