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
interface IFruit { | |
name: string | |
qty: number | |
price: number | |
} | |
const FruitStand = () => { | |
const fruits = new Map<string, IFruit>(); | |
const addFruit = (name: string, qty: number, price: number) => { |
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
const uniqueSum = (arr: number[]) => { | |
// Filter any number from the array that has repeating digits | |
const filterRepeatingDigits = (num: number) => { | |
const digits = num.toString().split(''); | |
return digits.length === new Set(digits).size; | |
} | |
// Obtain an array of numbers containing only numbers w/ non-repeating digits | |
const filtered = arr.filter(filterRepeatingDigits) |
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
/* | |
From the challenge provided, it is evident that the right-most number should be removed to get the maximum value when the digit is removed. | |
*/ | |
const removeDigit = (val, digit) => { | |
const length = digit.toString().length | |
if (length > 1) { | |
return console.log(`You can only pass a single digit`) | |
} | |
const str = val.toString() |
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
let array = [ | |
[1, 2, 3], | |
[4, 5, 6], | |
[7, 8, 9] | |
] | |
const flip = (array, direction = 'HORIZONTAL') => { | |
const temp = [...array] | |
if (direction.toUpperCase() === 'VERTICAL') { | |
return (temp.reverse()) |
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
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder. | |
Searching for devices... | |
Your application will be deployed only on the device specified by the provided index or identifier. | |
Executing before-watchPatterns hook from /Users/angelo/Projects/Round2Ipad/hooks/before-watchPatterns/nativescript-dev-webpack.js | |
Executing before-watch hook from /Users/angelo/Projects/Round2Ipad/hooks/before-watch/nativescript-dev-webpack.js | |
Copying template files... | |
Platform ios successfully added. v4.2.0 | |
Executing before-shouldPrepare hook from /Users/angelo/Projects/Round2Ipad/hooks/before-shouldPrepare/nativescript-dev-webpack.js | |
Preparing project... | |
Executing before-prepareJSApp hook from /Users/angelo/Projects/Round2Ipad/hooks/before-prepareJSApp/nativescript-dev-webpack.js |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Handle History Mode and custom 404/500" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> |