Skip to content

Commit 66329e0

Browse files
committed
second method added for 11 number algorithm
1 parent 80ddc2a commit 66329e0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,27 @@ Code implementation is much strait forward. You just need to compare both the st
10331033
// should return "12"
10341034
```
10351035
1036+
*2.Compare positions:*
1037+
<br>
1038+
1039+
* Check whether the position of characters in the 2 given strings are same.
1040+
* Convert the 2 strings into array of their character, for doing this we can use "split()" method. <br>
1041+
* The *.split()* method is used to split a string into an array of characters. It receives one argument which specifies the separator that determines where every split occurs.
1042+
1043+
* Using for loop we're gonna check every character of one string with the corresponding character of another string. <br>
1044+
* Have a look at the snippet below, you will get an idea.
1045+
1046+
1047+
```js
1048+
for(let i=0;i<arr_str1.length;i++){
1049+
if (arr_str1[i]===arr_str2[i]){
1050+
count++;
1051+
}
1052+
}
1053+
```
1054+
1055+
1056+
10361057
10371058
10381059
</p>

0 commit comments

Comments
 (0)