Skip to content

Commit fe0a2a2

Browse files
authored
chore: added questions
1 parent a8351bf commit fe0a2a2

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -7115,6 +7115,50 @@ const numbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5];
71157115
console.log(findMin(numbers)); // Output: 1
71167116
```
71177117
7118+
Remove special characters from the given string without using built-in methods:
7119+
7120+
```javascript
7121+
const input = "MA@NT+H(A+N)";
7122+
7123+
const remove = (str) => {
7124+
let result = '';
7125+
for (let i = 0; i < str.length; i++){
7126+
let char = str[i];
7127+
if(
7128+
(char >= 'A' && char <= 'Z') ||
7129+
(char >= 'a' && char <= 'z') ||
7130+
(char >= '0' && char <= '9') ||
7131+
char === ' '
7132+
){
7133+
result += char;
7134+
}
7135+
}
7136+
return result;
7137+
}
7138+
7139+
console.log(remove(input)); // Output=MANTHAN
7140+
```
7141+
7142+
Print the given values in matrix form without using built-in methods
7143+
7144+
```javascript
7145+
Output:
7146+
1 4 7
7147+
2 5 8
7148+
3 6 9
7149+
7150+
let input = [1, 2, 3, 4, 5, 6, 7, 8, 9];
7151+
7152+
// Manually print the matrix
7153+
for (let row = 0; row < 3; row++) {
7154+
let output = ""; // Initialize an empty string for each row
7155+
for (let col = 0; col < 3; col++) {
7156+
output += input[row + col * 3] + " "; // Calculate index and add spaces
7157+
}
7158+
console.log(output);
7159+
}
7160+
```
7161+
71187162
Write a function that calculates the sum of an array of numbers Without Inbuilt Method.
71197163
71207164
```javascript

0 commit comments

Comments
 (0)