{"id":22513544,"url":"https://github.com/emahtab/string-to-integer-atoi","last_synced_at":"2026-01-27T19:49:44.495Z","repository":{"id":79525803,"uuid":"277242111","full_name":"eMahtab/string-to-integer-atoi","owner":"eMahtab","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-05T06:12:01.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T23:30:01.706Z","etag":null,"topics":["leetcode","problem-solving","string-to-number"],"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/eMahtab.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,"zenodo":null}},"created_at":"2020-07-05T06:09:45.000Z","updated_at":"2020-07-05T06:12:54.000Z","dependencies_parsed_at":"2023-05-10T17:30:39.922Z","dependency_job_id":null,"html_url":"https://github.com/eMahtab/string-to-integer-atoi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eMahtab/string-to-integer-atoi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fstring-to-integer-atoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fstring-to-integer-atoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fstring-to-integer-atoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fstring-to-integer-atoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eMahtab","download_url":"https://codeload.github.com/eMahtab/string-to-integer-atoi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fstring-to-integer-atoi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28819854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T18:44:20.126Z","status":"ssl_error","status_checked_at":"2026-01-27T18:44:09.161Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["leetcode","problem-solving","string-to-number"],"created_at":"2024-12-07T03:13:13.472Z","updated_at":"2026-01-27T19:49:44.490Z","avatar_url":"https://github.com/eMahtab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sring to integer atoi\n## https://leetcode.com/problems/string-to-integer-atoi\n\n# Implementation :\n```java\nclass Solution {\n    public int myAtoi(String str) {\n       if (str == null) return 0;\n\t   str = str.trim();\n       if (str.length() == 0) return 0;\n        \n       char firstChar = str.charAt(0);\n       int sign = 1, start = 0, len = str.length();\n       long sum = 0;\n       if (firstChar == '+') {\n            sign = 1;\n            start++;\n       } else if (firstChar == '-') {\n            sign = -1;\n            start++;\n       }\n        \n       for (int i = start; i \u003c len; i++) {\n            if (!Character.isDigit(str.charAt(i)))\n                return (int) sum * sign;\n            sum = sum * 10 + str.charAt(i) - '0';\n            if (sign == 1 \u0026\u0026 sum \u003e Integer.MAX_VALUE)\n                return Integer.MAX_VALUE;\n            if (sign == -1 \u0026\u0026 (-1) * sum \u003c Integer.MIN_VALUE)\n                return Integer.MIN_VALUE;\n       }\n\n     return (int) sum * sign;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fstring-to-integer-atoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femahtab%2Fstring-to-integer-atoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fstring-to-integer-atoi/lists"}