forked from garageScript/algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solve garageScript#47, Lesson 2: mostCommon - Takes in an array of nu…
…mbers & find the most common number
- Loading branch information
Alberto Lopez
committed
Oct 20, 2017
1 parent
52500f1
commit 3fa101e
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const solution = require('../solutions/mostCommon.js'); | ||
|
||
const mostComm = (ar, result)=>{ | ||
if(solution(ar) == result){ | ||
console.log('Most common number'); | ||
}else{ | ||
console.log('Not most common number'); | ||
} | ||
} | ||
mostComm([2,21,2,3,3,3,1],3); |