# Category: String

## 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 …

## 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 …

## Find first duplicate character in a string in Java

Problem:  Write a Java program to find first duplicate character in a string. For example: If given string is color, then the first duplicate character in the string is …

## Reverse words in a string in Java

Problem: Write a Java program to reverse words in a string. For example: Input sentence :  Java fries is an awesome site for programming questions Output: questions programming for site …

## First non repeating character in a string in Java

Problem: Write a Java program to find first non repeating character in a string or first unique character in a string. For example. 1. In string “baby”, first non repeating …

## Pangram : Check if a string has all the letters of alphabet

Problem: Check if a sentence is a pangram or check if a string has all the letters of alphabet. What is a pangram? A Pangram is a sentence which contains …

## Longest substring without repeating characters

Problem: Find longest substring without repeating characters. This program is asked in programming interviews. Easy and elegant solution is expected. Ex: If the input string is “abcabcd” then the longest …

## Reverse string – reverse a string in Java

In this post we will see how to reverse string in Java. There are various ways of reversing a string in Java. This program is asked in many entry level …

## find the smallest sub string in str1 which contains all the characters in str2 and not those in str3

Problem: Given three strings str1, str2 and str3;  find the smallest sub string in str1 which contains all the characters in str2 (in any order) and not those in …