Skip to content

Commit 05de736

Browse files
committed
add syntax highlight 🌼
1 parent 7e16a6c commit 05de736

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

README.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You are given a variable celsius representing a temperature in Celsius. Use the
3030

3131
### Solution
3232

33-
```
33+
```js
3434
function convertToF(celsius) {
3535
let fahrenheit = (celsius * 9) / 5 + 32;
3636
return fahrenheit;
@@ -53,7 +53,7 @@ Your result must be a string.
5353

5454
### Solution 1
5555

56-
```
56+
```js
5757
function reverseString(str) {
5858
return str.split("").reverse().join("");
5959
}
@@ -63,7 +63,7 @@ reverseString("hello");
6363

6464
### Solution 2
6565

66-
```
66+
```js
6767
function reverseString(str) {
6868
let reversedString = "";
6969
for (let i = str.length - 1; i >= 0; i--) {
@@ -73,7 +73,6 @@ function reverseString(str) {
7373
}
7474

7575
reverseString("hello");
76-
7776
```
7877

7978
### 3. Factorialize a Number
@@ -94,20 +93,19 @@ Only integers greater than or equal to zero will be supplied to the function.
9493

9594
### Solution 1
9695

97-
```
96+
```js
9897
function factorialize(num) {
9998
if (num === 0) {
10099
return 1;
101100
} else return num * factorialize(num - 1);
102101
}
103102

104103
factorialize(5);
105-
106104
```
107105

108106
### Solution 2
109107

110-
```
108+
```js
111109
function factorialize(num) {
112110
let factorializedNumber = 1;
113111
for (let i = 2; i <= num; i++) {
@@ -117,8 +115,6 @@ function factorialize(num) {
117115
}
118116

119117
factorialize(5);
120-
121-
122118
```
123119

124120
### 4. Find the Longest Word in a String
@@ -131,9 +127,9 @@ Your response should be a number.
131127

132128
---
133129

134-
### Solution 1
130+
### Solution
135131

136-
```
132+
```js
137133
function findLongestWordLength(str) {
138134
let splitWords = str.split(" ");
139135
let longestWordLength = 0;
@@ -147,5 +143,4 @@ function findLongestWordLength(str) {
147143
}
148144

149145
findLongestWordLength("The quick brown fox jumped over the lazy dog");
150-
151146
```

0 commit comments

Comments
 (0)