Palindrome String

    0

    0

    Mansimar Anand

    Check if the given string is palindrome or not

    bool isPalindrome(string str) {
        int left = 0;
        int right = str.size() - 1;
        while (left < right) {
            if (str[left++] != str[right--]) {
                return false;
            }
        }
        return true;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.