Skip to content

Commit 0e948cc

Browse files
committed
1295-find-numbers-with-even-number-of-digits-a
1 parent 98031e1 commit 0e948cc

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var findNumbers = function (nums) {
6+
let count = 0;
7+
for (let num of nums) {
8+
if ((num.toString().length & 1) === 0) {
9+
count++;
10+
}
11+
}
12+
return count;
13+
};

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# 🚀 LeetCode JS Easy Solutions
2+
3+
Welcome to my **LeetCode JavaScript Easy Solutions** repository! 🎉 This repository contains solutions to various **easy-level** problems from LeetCode. Each solution is written in JavaScript, and I provide detailed analysis of the problem and my approach to solving it. 📝
4+
5+
## 👨‍💻 Author: Muhammad Zeeshan
6+
7+
🔗 **Portfolio:** [ZeePortfolio](https://mzeeshan138.github.io/ZeePortfolio/)
8+
🐙 **GitHub:** [mzeeshan138](https://github.com/mzeeshan138)
9+
📧 **Email:** muhammadzeeshan588685@gmail.com
10+
🔗 **LinkedIn:** [Muhammad Zeeshan](https://www.linkedin.com/in/muhammad-zeeshan-087584306/)
11+
🔗 **LeetCode Profile:** [Zeeshan's LeetCode Profile](https://leetcode.com/u/zeeshan106/)
12+
13+
---
14+
15+
## 📂 Problem List
16+
17+
This repository currently includes solutions for LeetCode's **easy-level** problems. Here's the breakdown:
18+
19+
- **9. Palindrome Number**
20+
21+
---
22+
23+
## 🎯 Problem: Palindrome Number (LeetCode 9)
24+
25+
### Problem Statement:
26+
27+
Given an integer `x`, return `true` if `x` is a palindrome, and `false` otherwise.
28+
29+
Example 1:
30+
Input: `x = 121`
31+
Output: `true`
32+
Explanation: `121` reads the same backward as forward.
33+
34+
Example 2:
35+
Input: `x = -121`
36+
Output: `false`
37+
Explanation: `-121` is not a palindrome. Reading it from right to left gives `121-`.
38+
39+
Example 3:
40+
Input: `x = 10`
41+
Output: `false`
42+
Explanation: `10` is not a palindrome since the reverse is `01`.
43+
44+
---
45+
46+
### 🔍 **Solution Analysis:**
47+
48+
- **Time Complexity:**
49+
⏱️ O(log n)
50+
We reverse half of the digits of the number, so the time complexity depends on the number of digits in `x`.
51+
52+
- **Space Complexity:**
53+
💾 O(1)
54+
We only use a constant amount of space to store the `reverted` number.
55+
56+
- **Test Cases:**
57+
✅ Passed all **11,511** hidden and sample test cases on LeetCode!
58+
59+
---
60+
61+
### 🏆 **Performance Results:**
62+
63+
- ⚡️ **Runtime:** 3 ms (Beats **98.69%** of JavaScript solutions)
64+
- 🧮 **Memory Usage:** 63.98 MB (Beats **79.21%** of JavaScript solutions)
65+
66+
---
67+
68+
### 🔗 **GitHub Repo:**
69+
70+
🔗 [leetcode-js-easy-solutions](https://github.com/mzeeshan138/leetcode-js-easy-solutions.git)
71+
You can find the code for this solution in the file `9-palindrome-number.js`.
72+
73+
---
74+
75+
## 🛠️ Technologies Used
76+
77+
- **JavaScript (ES6+)** – Core programming language
78+
- **Git & GitHub** – Version control and collaboration
79+
80+
---
81+
82+
## 🌟 Features
83+
84+
**Efficient and optimized solutions** 💻
85+
**Beginner-friendly and easy to understand** 🎓
86+
**Clear explanations and performance analysis** 🧠
87+
**Well-organized problem-solving approach** 🏆
88+
89+
---
90+
91+
## 🤝 Contributing
92+
93+
Feel free to fork this repository, add your solutions, and submit a pull request! 🚀
94+
Let's improve and grow together. 🎉
95+
96+
---
97+
98+
## 📬 Contact
99+
100+
📧 **Email:** muhammadzeeshan588685@gmail.com
101+
🔗 **LinkedIn:** [Muhammad Zeeshan](https://www.linkedin.com/in/muhammad-zeeshan-087584306/)
102+
🐙 **GitHub:** [mzeeshan138](https://github.com/mzeeshan138)
103+
104+
---
105+
106+
**If you find this repository helpful, please give it a star!**

0 commit comments

Comments
 (0)