Palindrome


Submit solution

Points: 20 (partial)
Time limit: 180.0s
Memory limit: 24K

Problem type

Given a string, we need to check whether it is possible to make this string a palindrome after removing exactly one character from this.


Comments


  • 1
    CSE22_115  commented on June 7, 2023, 9:35 p.m.

    hello


  • 0
    ashok_57  commented on May 27, 2023, 12:50 a.m. edit 5

    ashok


  • 0
    EEE22137  commented on May 24, 2023, 2:59 p.m.

    // reversed integer is stored in reversed variable while (n != 0) { remainder = n % 10; reversed = reversed * 10 + remainder; n /= 10; }

    // palindrome if orignal and reversed are equal if (original == reversed) printf("%d is a palindrome.", original); else printf("%d is not a palindrome.", original);

    return 0; }


  • 0
    Cbenu4cce_22017  commented on May 15, 2023, 4:45 p.m.

    include <stdio.h>

    int main() { int n, reversed = 0, remainder, original; printf("Enter an integer: "); scanf("%d", &n); original = n;

    // reversed integer is stored in reversed variable
    while (n != 0) {
        remainder = n % 10;
        reversed = reversed * 10 + remainder;
        n /= 10;
    }
    
    // palindrome if orignal and reversed are equal
    if (original == reversed)
        printf("%d is a palindrome.", original);
    else
        printf("%d is not a palindrome.", original);
    
    return 0;

    }


  • 0
    EEE22118  commented on May 10, 2023, 3:41 p.m. edited

    .