Java Programs – LeetCode – Ransom Note – Solution 1

Problem Statement https://leetcode.com/problems/ransom-note/ Given an arbitrary ransom note string and another string containing letters from all the magazines, write a…

Java Program To Find Closest Value Of A Given Number In Sorted Array

We have already learned a Java Program to find the closest value of a given number in an unsorted array.…

Frequently Asked Java Program 28: Java Program to Find if Given Number Is a Perfect Number

Perfect Number: A Perfect number is a positive integer that is equal to the sum of its proper divisors excluding the number itself.…

Frequently Asked Java Program 27: Java Program to Find Occurrence of Any Char in a Given String Without Iterating

Problem Statement: Find occurrence of given char  (Ignore case)  in given string without iterating through string. Input – Make Selenium Easy…

Frequently Asked Java Program 26: Java Program to Find Occurrence of Each Char in a Given String Without Using Collection

Problem Statement: Write a program to print occurrence of each character in given string without using Collection. Example:- Please enter…

Frequently Asked Java Program 25: Java Program to Convert a String Sentence in Camel Case

“CamelCase” is a naming convention in which words are joined together without any whitespace in between and each word starts…

Frequently Asked Java Program 24: Java Program to Capitalize First Character of Each Word in a String Sentence

Problem Statement: Input: make selenium easy Output: Make Selenium Easy Convert first character of each word into upper case. Solution:…

Frequently Asked Java Program 23: Java Program to Remove Extra WhiteSpace Between Words In Given String

Problem Statement: Remove extra white spaces between words. Only one white space is allowed between words. If more than one,…

Frequently Asked Java Program 21: Java Program to Find & Print All Special Characters with Their Positions in a String

This programming interview question was asked in Yodlee.  Problem: Write a Java program to find and print all special characters…