We want to prepare the perfect curry with ingredients P, Q, and R.
"A" is a zero-indexed array of N integers.
Elements of A are integers within the range [−99,999,999 to 99,999,999]
The curry is a string consisting of N characters such that each character is either P, Q, or R and the
corresponding index of the array is the weight of each ingredient.
The curry is perfect if the sum of the total weights of P, Q, and R is equal.
Write a function
function makeCurry(Array);
such that, given a zero-indexed array Array consisting of N integers, returns the perfect curry of this array.
The function should return the string "noLuck" if no perfect curry exists for that Array.
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
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { tw } = require('./tw.cjs'); | |
| function addPrefixToClasses(filePath) { | |
| console.log('processing... ', filePath); | |
| const fileContent = fs.readFileSync(filePath, 'utf8'); | |
| let modifiedContent = fileContent; | |
| tw.forEach((item) => { | |
| console.log(item); |
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
| import { useEffect, useState } from "react"; | |
| import { RhButton } from "@rhythm-ui/react"; | |
| const SelectionArea = ({ onCancel, onCapture }) => { | |
| const [startPosition, setStartPosition] = useState({ x: 0, y: 0 }); | |
| const [endPosition, setEndPosition] = useState({ x: 0, y: 0 }); | |
| const [selectState, setSelectState] = useState("init"); | |
| const handleMouseDown = (e) => { | |
| if (selectState == "init") { | |
| const { clientX, clientY } = e; |
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
| image: node:10 | |
| cache: | |
| paths: | |
| - node_modules/ | |
| before_script: | |
| - apt-get update -qq && apt install -y openssh-client openssh-server | |
| - mkdir -p ~/.ssh | |
| - echo -e "$SSH_PRIVATE_KEY" > ~/deploy.pem |
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
| var links = document.getElementsByTagName('a'), hrefs = [], sendIt = ''; | |
| for (var i = 0; i<links.length; i++) | |
| { | |
| if(links[i].href.includes('mailto')) { | |
| var email = links[i].href.replace('mailto:',''); | |
| //If you want to use this as array | |
| hrefs.push(email); | |
| //If you want to copy all email ids in one string (usually to send mail to multiple ids at once) | |
| sendIt += email + ', '; |
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
| <div id="three-container"></div> | |
| <div id="instructions"> | |
| click and drag to control the animation | |
| </div> |
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
| var config = { | |
| apiKey: "yOurAppAPIkey11", | |
| authDomain: "your-app.firebaseapp.com", | |
| databaseURL: "https://your-app.firebaseio.com", | |
| projectId: "your-app", | |
| storageBucket: "your-app.appspot.com", | |
| messagingSenderId: "3034404405537" | |
| }; | |
| firebase.initializeApp(config); |
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
| for (var i = 0; i <= 100; i++) { | |
| if (i % 3 == 0 && i % 5 == 0) { | |
| console.log('FizzBuzz') | |
| } else if (i % 3 == 0) { | |
| console.log('Fizz') | |
| } else if (i % 5 == 0) { | |
| console.log('Buzz') | |
| } else { | |
| console.log(i) | |
| } |
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
| <?php | |
| $chrome_path = 'C:\"Program Files (x86)"\Google\Chrome\Application\chrome.exe'; // for windows user | |
| $chrome_path = 'chromium-browser'; // for linux user, first install chromium-browser to linux | |
| $output_file = 'path/to/store/sample.pdf'; | |
| $url = 'http://www.google.com'; | |
| $command = $chrome_path . " --headless --disable-gpu --enable-logging --print-to-pdf=" | |
| . $output_file . " " . $url . " --virtual-time-budget=1000 "; // virtual-time-budget is used for delay loading js | |
| try { | |
| exec($command); | |
| } catch (Exception $ex) { |
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
| DataGrid dg = new DataGrid(); | |
| dg.HorizontalAlignment = HorizontalAlignment.Left; | |
| dg.VerticalAlignment = VerticalAlignment.Top; | |
| dg.AutoGenerateColumns = true; | |
| //the function getData used to get the data from data-source, you can manipulate it. | |
| getData gd = new getData(); // getData holds getUserRecord() to get the data | |
| UserData[] data = gd.getUserRecord(); | |
| dg.ItemsSource = data; |
NewerOlder