Created
July 2, 2017 09:01
-
-
Save yosangwon/b1478c5d3bdc2e1aeff5e606e71d7fa2 to your computer and use it in GitHub Desktop.
1.15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(third). | |
-export([x0r1/2, x0r2/2, x0r3/2, maxThree/3, howManyEqual/3]). | |
x0r1(A,B) -> | |
A =/= B. | |
x0r2(A,B) -> | |
not (A == B). | |
x0r3(A,B) -> | |
((not A and B) or (A and not B)). | |
maxThree(X,Y,Z) -> | |
max(max(X,Y),Z). | |
howManyEqual(X,X,X) -> 3; | |
% if the last argument was same, that should matched above. | |
howManyEqual(X,X,_) -> 2; | |
howManyEqual(X,_,X) -> 2; | |
howManyEqual(_,X,X) -> 2; | |
howManyEqual(_,_,_) -> 0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment