## Find minimum distance to reach nearest 0

Problem: Given a matrix of -1’s and 0’s, display matrix which contains minimum distance to reach nearest 0 for that particular position. Example: Input matrix: -1 0 -1 -1 -1 …

Problem: Given a matrix of -1’s and 0’s, display matrix which contains minimum distance to reach nearest 0 for that particular position. Example: Input matrix: -1 0 -1 -1 -1 …

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 …

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 …

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 …

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 …

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 …

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 …

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 …

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

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

Java-fries Copyright © 2018.