Skip to content

Commit

Permalink
day 3 code (#42)
Browse files Browse the repository at this point in the history
* Add @Shashankjain12 as a contributor

* contribution commit

* Day1 and Day2

* Update README.md

* Day 3 updated
  • Loading branch information
Shashankjain12 authored and MadhavBahl committed Dec 24, 2018
1 parent 813fbac commit 3befec1
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 145 deletions.
2 changes: 2 additions & 0 deletions Day2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ if d==e:
else:
print("Not a pallindrome")
```

## Ruby implementation

### [palindrome.rb](./Ruby/palindrome.rb)
Expand All @@ -673,3 +674,4 @@ def palindrome(str)
end
```


13 changes: 13 additions & 0 deletions Day3/Python/Shashankham.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
* @author: Shashank Jain
* @date: 24/12/2018
"""

a=input("Enter the first string?")
b=input("Enter the second string?")
c=list(a.replace(" ",""))
d=list(b.replace(" ",""))
k=[i for i,j in zip(c,d) if i!=j]
print("list of unmatched characters are:",k)
print("number of characters not matching are:",len(k))

18 changes: 17 additions & 1 deletion Day3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ void main(){
printf("Hamming Distance = %d", HD);
}
```
## Python Implementation
### [Solution](./Python/HammingDistance.py)
Expand Down Expand Up @@ -244,7 +243,24 @@ if( HD is None ):
else:
print("Hamming Distance = ", HD)
```
##Python Implementation

### [Solution](./Python/Shashankham.py)
``` Python
"""
* @author: Shashank Jain
* @date: 24/12/2018
"""

a=input("Enter the first string?")
b=input("Enter the second string?")
c=list(a.replace(" ",""))
d=list(b.replace(" ",""))
k=[i for i,j in zip(c,d) if i!=j]
print("list of unmatched characters are:",k)
print("number of characters not matching are:",len(k))

```
## Why Hamming Distance?

The #1 reason for not being successful is inconsistency, and it is a common trend that people start something and on give up on the third day itself, and one of the major reasons behind that is that they find it difficult to continue. 
Expand Down
Loading

0 comments on commit 3befec1

Please sign in to comment.