# Category: programming

## Find number of customers who left without using a computer

Problem: Find number of customers who left without using a computer. This program was asked in makeMyTrip interview. Western union owns several cyber cafes. A research firm did an analysis …

## Find next greater number with same set of digits in Java

Problem: Given a number, find next greater number with the same set of digits as original number. For example, if input number is 1234, then output should be 1243 if …

## Check if characters of a given string can be rearranged to form a palindrome

Problem: Check if characters of a given string can be rearranged to form a palindrome. Or, write a Java program to check if a given string is a rotation …

## Alternating characters Hackerrank Java solution

Problem: Given a string, find minimum number of deletions required so that there will be no two consecutive repeating characters in the string. This is one of the challenge …

## Reverse a number using stack in Java

Problem: Reverse a number using stack data structure. Stack is a LIFO (Last In First Out) data structure. i.e. last element pushed onto the stack is popped out first. Java provides in-built stack …

## Find a maximum number that can be formed from digits of a number

Problem: Write a Java program to find a maximum number that can be formed from the digits of a given number. For example: If the given number is 38293367, then …

## Find two numbers that add to a sum in an array in Java

Problem: Write a Java program to find two numbers that add to a sum in an array. A solution of time complexity Ο(n) is expected. Example: If the input …

## Distinct elements in an array

Problem: Write a Java program to find distinct elements in an array. For example, if input array is { 2, 4, 3, 2, 6, 9, 4, 6 } then, …

## Maximum repeating element in an array in Java

Problem: Write a Java program to find maximum repeating element in an array of integers in Java. Or write a program to find most popular element in an array. …

## Sort elements by frequency

Problem: Sort elements by frequency. Sort elements of an array by frequency of the elements of the array. Sort the elements by decreasing order of their frequency. If two …