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
| function countDivisibleBy11(list) { | |
| let count = 0; | |
| for (let i = 0; i < list.length; i++) { | |
| if (list[i] >= 111) { | |
| return 0; | |
| } | |
| if (list[i] % 11 === 0) { | |
| count++; | |
| } | |
| } |
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
| function fizzbuzz(n) { | |
| let result = []; | |
| for (let i = 1; i <= n; i++) { | |
| let output = ""; | |
| if (i % 3 === 0) { | |
| output += "Fizz"; | |
| } | |
| if (i % 5 === 0) { | |
| output += "Buzz"; | |
| } |
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 axios = require('axios'); | |
| async function summarizeNovel(text) { | |
| const response = await axios.post('https://api.openai.com/v1/engines/text-davinci-002/jobs', { | |
| prompt: 'Please summarize this text:', | |
| max_tokens: 100, | |
| temperature: 0.5, | |
| n: 1, | |
| stop: ['Thank you.'], | |
| text, |
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 React, { useState } from 'react'; | |
| const LogoGenerator = () => { | |
| const [city, setCity] = useState(''); | |
| const [logo, setLogo] = useState(null); | |
| const handleSubmit = event => { | |
| event.preventDefault(); | |
| // Example code to generate logo based on city name | |
| // Replace this with a real logo generation code |
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 React, { useState } from "react"; | |
| const LogoGenerator = () => { | |
| const [city, setCity] = useState(""); | |
| const handleSubmit = (event) => { | |
| event.preventDefault(); | |
| // Call API to generate logo based on city name | |
| // ... | |
| }; |
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
| //SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract Mood { | |
| string currentMood; | |
| function setMood(string memory _newMood) external { | |
| currentMood = _newMood; | |
| } |
NewerOlder