-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrepl.txt
More file actions
37 lines (29 loc) · 750 Bytes
/
repl.txt
File metadata and controls
37 lines (29 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{alias}}( s1, s2 )
Calculates the Hamming distance between two equal-length strings by
comparing Unicode code points.
The function returns a sentinel value of -1 if the two input strings differ
in the number of Unicode code points.
Parameters
----------
s1: string
First input string.
s2: string
Second input string.
Returns
-------
out: number
Hamming distance.
Examples
--------
> var d = {{alias}}( 'algorithms', 'altruistic' )
7
> d = {{alias}}( 'elephant', 'hippopod' )
7
> d = {{alias}}( 'javascript', 'typescript' )
4
> d = {{alias}}( '👋', '🌍' )
1
> d = {{alias}}( 'a👋', 'b🌍' )
2
See Also
--------