function createArrayOfFunctions(y) {
var arr = [];
for(var i = 0; i<y; i++) {
arr[i] = function(x) { return x + i; }
}
return arr;
}
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
class Solution { | |
public static boolean isValid(String s) { | |
char[] charArray = s.toCharArray(); | |
List<Character> stack = new ArrayList<>(); | |
for (char c : charArray) { | |
switch (c) { | |
case '(': | |
case '[': | |
case '{': |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> | |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> | |
</head> | |
<body style="height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center; flex-direction: column;"> |
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
#include <LWiFi.h> | |
#include <LWiFiClient.h> | |
#include <LWiFiServer.h> | |
#include <LWiFiUdp.h> | |
#include <Wire.h> | |
#include <LBattery.h> | |
#include <LGPS.h> | |
#define WIFI_AP "error404" |
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
//------------------------------------------------------------------------------ | |
// <copyright file="MainWindow.xaml.cs" company="Microsoft"> | |
// Copyright (c) Microsoft Corporation. All rights reserved. | |
// </copyright> | |
//------------------------------------------------------------------------------ | |
namespace Microsoft.Samples.Kinect.ColorBasics | |
{ | |
using System; | |
using System.ComponentModel; | |
using System.Diagnostics; |
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
/* | |
-------------------------------------------------------------------------------------------------------------------------- | |
| Title: Next Fibonacci | | |
| Usage: Give some integers, the function NextFibonacci::nextFibonacci() will return the next fibonacci numbers which are| | |
| greater than input numbers. | | |
| P.S. the table of fibonacci numbers in this program starts by F1 = 1, instead of F0 = 0. | | |
| | | |
| Example: | | |
| arr[] = { 1,9,22 }; | | |
| nextFibonacci(arr); |
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
/* | |
-------------------------------------------------------------------------------------------------------------------------- | |
| Title: Check Subset | | |
| Usage: Sequentially enter two sets of uppercase alphabet, then this prgram will show a result of 'True' or 'False', to | | |
| show you if the second set is a subset of the first one. | | |
| | | |
| Example: | | |
| Please enter set1: ABCD | | |
| Please enter set2: CD | | |
| True. |
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 random | |
def generate(): | |
a = random.choice('0123456789') | |
b = random.choice('0123456789') | |
while b == a: | |
b = random.choice('0123456789') | |
c = random.choice('0123456789') | |
while c == b or c == a: | |
c = random.choice('0123456789') | |
d = random.choice('0123456789') |
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
/* | |
-------------------------------------------------------------------------------------------------------------------------- | |
| Title: Next Fibonacci | | |
| Usage: Give some integers, the function NextFibonacci::nextFibonacci() will return the next fibonacci numbers which are| | |
| greater than input numbers. | | |
| P.S. the table of fibonacci numbers in this program starts by F1 = 1, instead of F0 = 0. | | |
| | | |
| Example: | | |
| arr[] = { 1,9,22 }; | | |
| nextFibonacci(arr); |
NewerOlder