Palindromic Partitioning

Problem Statement Given an integer array,  partitioning the array is said to be a palindrome partitioning if every subarray of the partition is a palindrome. For example, 1 | 2 2 2 | 23 | 4 is a palindrome partitioning of array { 1,2,2,2,23,4 }. You have to find out the fewest cuts needed for palindrome partitioning of a…

Read more...

String to Integer (atoi)

Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value. The string can contain…

Read more...

HashMap in JAVA

Consider a scenario where we need to store data in the form of key value pairs. Which data structure will we use? Well, The obvious answer which comes in our mind is Map. HashMap is Hash table based implementation of the Map interface which stores data in the form of key value pairs. This class provides…

Read more...

Convert int to String and String to int

This is one of the most occurred scenario where we need to convert a Integer to String or a String to Integer. We can attain that by using methods of wrapper classes. Here we are discussing about Integer -> String or String ->Integer. String to int To convert String to Integer we can use parseInt()….

Read more...
Bitnami