Last active
March 25, 2021 19:31
-
-
Save paul-ridgway/7e256b9560de559f7bd4bb09ffc4f247 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
/* | |
* Complete the 'strokesRequired' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts STRING_ARRAY picture as parameter. | |
*/ | |
function strokesRequired(picture) { | |
// Write your code here | |
return 5; | |
} | |
function main() { | |
let picture = ` | |
aaaba | |
aaaba | |
aaacb`.split("\n").filter(r => !!r); | |
//let picture = `aaabaaaabaaaacb`.split("\n") .filter(r => !!r).map(r => r.split('')); | |
const result = strokesRequired(picture); | |
console.log(result); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/paul-ridgway/014d45aa38a19967c5302bd138e726b5 for an implementation