{"id":23684089,"url":"https://github.com/lepharamramchiary/palindrome-number-cpp-opps-leetcode","last_synced_at":"2026-01-06T06:30:18.852Z","repository":{"id":156031552,"uuid":"602920616","full_name":"LepharamRamchiary/Palindrome-Number-cpp-opps-leetcode","owner":"LepharamRamchiary","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-17T08:27:50.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T20:33:28.998Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LepharamRamchiary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-17T08:23:09.000Z","updated_at":"2023-05-03T07:36:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"2986b98b-4232-4d5e-9219-1fe49c27d68f","html_url":"https://github.com/LepharamRamchiary/Palindrome-Number-cpp-opps-leetcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LepharamRamchiary%2FPalindrome-Number-cpp-opps-leetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LepharamRamchiary%2FPalindrome-Number-cpp-opps-leetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LepharamRamchiary%2FPalindrome-Number-cpp-opps-leetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LepharamRamchiary%2FPalindrome-Number-cpp-opps-leetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LepharamRamchiary","download_url":"https://codeload.github.com/LepharamRamchiary/Palindrome-Number-cpp-opps-leetcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239735910,"owners_count":19688361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp"],"created_at":"2024-12-29T20:33:16.595Z","updated_at":"2026-01-06T06:30:18.791Z","avatar_url":"https://github.com/LepharamRamchiary.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"**# Palindrome Number in C++(oops)**\n\n**Question**\n\nGiven an integer x, return true if x is a palindrome, and false otherwise.\n\nExample 1:\n```\nInput: x = 121\nOutput: true\nExplanation: 121 reads as 121 from left to right and from right to left.\n```\nExample 2:\n```\nInput: x = -121\nOutput: false\nExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.\n```\nExample 3:\n```\nInput: x = 10\nOutput: false\nExplanation: Reads 01 from right to left. Therefore it is not a palindrome.\n```\n\n**Solution**:-\n```c++\n#include\u003cbits/stdc++.h\u003e\n\nusing namespace std;\n\nclass Solution {\npublic:\n    bool isPalindrome(int x) {\n        stack\u003cint\u003e st;\n        if (x \u003c 0) {\n            return false;\n        }\n        int y = x;\n        while (x) {\n            st.push(x % 10);\n            x /= 10;\n        }\n        while (y) {\n            if (st.top() != (y % 10)) {\n                return false;\n            }\n            st.pop();\n            y /= 10;\n        }\n        return true;\n    }\n};\n\nint main() {\n    int x;\n    cout \u003c\u003c \"Enter a number: \";\n    cin \u003e\u003e x;\n\n    Solution sol;\n    if (sol.isPalindrome(x)) {\n        cout \u003c\u003c x \u003c\u003c \" is a palindrome.\" \u003c\u003c endl;\n    } else {\n        cout \u003c\u003c x \u003c\u003c \" is not a palindrome.\" \u003c\u003c endl;\n    }\n\n    return 0;\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepharamramchiary%2Fpalindrome-number-cpp-opps-leetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flepharamramchiary%2Fpalindrome-number-cpp-opps-leetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepharamramchiary%2Fpalindrome-number-cpp-opps-leetcode/lists"}