About 2,440,000 results
Open links in new tab
  1. java - Count how many palindromes in a string - Stack Overflow

    Jun 19, 2019 · The solution in this answer is O(n²) because the search for a palindrome of length m centered at a given pivot takes only O(1), which is possible because it uses the result of the …

  2. java - how to count the number of palindromes formed by

    Dec 16, 2016 · There's a much simpler way of counting palindromes. I'm not going to write code for you, but I'll describe the approach. Since you have to use all characters of the input, then …

  3. Count maximum-length palindromes in a String - GeeksforGeeks

    Nov 24, 2022 · Given a string, count how many maximum-length palindromes are present. (It need not be a substring) Examples: "ababa", "baaab" . "ababa", "baaab", "abbba", "babab" …

  4. Palindrome Substrings Count - GeeksforGeeks

    Mar 8, 2025 · // Java program to count all palindromic substrings of // given string using bottom-up DP import java.util.*; class GfG {static int countPS (String s) {int n = s. length (); int res = 0; …

  5. Java way to check if a string is palindrome - Stack Overflow

    Aug 9, 2017 · I guess this is simple way to check palindrome. String strToRevrse = "MOM"; strToRevrse.equalsIgnoreCase(new StringBuilder(strToRevrse).reverse().toString());

  6. Count palindrome words in a sentence - GeeksforGeeks

    Nov 22, 2022 · countPalin () function counts the number of palindrome words by extracting every word of the string and passing it to checkPalin () function. An extra space is added in the …

  7. How to check if a String is a Palindrome using Java 8 Streams

    Dec 9, 2019 · In this post, we will see “How to check if the String or Number is Palindrome or not with the help of Java 8 Streams API?” Java 8 Streams power to test Palindrome... Check it …

  8. Display and count palindromic words in a sentence in Java

    Feb 19, 2014 · The problem implementing the palindromic words and the count of palindromic words is as follows: import java.util.*; class Palindrome{ public static void main(String args[]){ …

  9. Java Program to Check Whether Given String is a Palindrome

    Palindrome String Check Program in Java. This Java program asks the user to provide a string input and checks it for the Palindrome String. Scanner class and its function nextLine() is used …

  10. java - Count palindrome substrings - Code Review Stack Exchange

    Mar 11, 2018 · Given a string S, count and return the number of substrings of S that are palindromes. Single length substrings are also palindromes. We just have to count the …

Refresh