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
| interface ConsoleBrainerTypes { | |
| label: string | |
| text?: "" | any | |
| highlight?: string | Array<string> | |
| type?: "log" | "info" | "warn" | "error" | |
| whole?: boolean | |
| textColor?: "" | "red" | "green" | "yellow" | "blue" | "purple" | "cyan" | |
| bgColor?: "" | "red" | "green" | "yellow" | "blue" | "purple" | "cyan" | |
| } |
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
| /* Simple Monsoon Umbrella Problem Solution in Node.js */ | |
| function solve (n, umbrella) { | |
| if (umbrella === null || umbrella.length === 0 || n < 1) | |
| return -1 // Ez Pz | |
| var i = umbrella.length - 1 | |
| umbrella.sort() // or umbrella.reverse() but reverse the below condtions. | |
| // umbrella = sortMe(umbrella) // Use this if sort funtion isn't available in hackerrank. | |
| var count = 0 | |
| while (n >= 0 && i >= 0) { // or reverse |