Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
| function countApplesAndOranges(s, t, a, b, apples, oranges) { | |
| // Write your code here | |
| let orangeCounter = 0; | |
| let appleCounter = 0; | |
| for(let i = 0; i<apples.length; i++){ | |
| if(a+apples[i] >= s && a+apples[i] <= t){ | |
| appleCounter++; | |
| } | |
| } |
| import React from 'react'; | |
| import moment from 'moment'; | |
| import { useEffect, useState } from 'react'; | |
| const Calender = () => { | |
| const [currentYear, setCurrentYear] = useState(moment().year()); | |
| const [currentMonth, setCurrentMonth] = useState(moment().month()); | |
| const [currentDate, setCurrentDate] = useState(moment().date()); | |
| const [currentDay, setCurrentDay] = useState(moment().day()); | |
| const [startFromLastWeek, setStartFromLastWeek] = useState(false); |
| import moment from 'moment'; | |
| import { useEffect, useState } from 'react'; | |
| const Calender = (props) => { | |
| const [currentYear, setCurrentYear] = useState(moment().year()); | |
| const [currentMonth, setCurrentMonth] = useState(moment().month()); | |
| const [currentDate, setCurrentDate] = useState(moment().date()); | |
| const [currentDay, setCurrentDay] = useState(moment().day()); | |
| const [startFromLastWeek, setStartFromLastWeek] = useState(false); | |
| const [currentWeek, setCurrentWeek] = useState({}); |
| /** | |
| * @param {number[]} nums | |
| * @return {number} | |
| */ | |
| var singleNumber = function(nums) { | |
| let sortedArray = nums.sort((a,b)=>a-b) | |
| for(let i=0;i<sortedArray.length; i+=2){ | |
Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.
Source: tutorialspoint.com
| # @param {Character[]} s | |
| # @return {Void} Do not return anything, modify s in-place instead. | |
| def reverse_string(s) | |
| for i in (0..((s.length - 1) / 2)) do | |
| tmp = s[i] | |
| s[i] = s[s.length - 1 - i] | |
| s[s.length - 1 - i] = tmp | |
| end | |