Skip to content

Instantly share code, notes, and snippets.

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 '{':
@AlexMeow
AlexMeow / 你比我猜.html
Created December 31, 2024 06:41
尾牙玩遊戲用的抽題網頁
<!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;">
#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"
//------------------------------------------------------------------------------
// <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;

修改前

function createArrayOfFunctions(y) {
    var arr = [];
    for(var i = 0; i<y; i++) {
        arr[i] = function(x) { return x + i; }
    }
    return arr;
}
/*
--------------------------------------------------------------------------------------------------------------------------
| 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);

Answer2

The following is the main algorithm in my answer1.

for (it2 = set2.begin(); it2 != set2.end(); it2++)
{
	bool isContained = false;

	for (it1 = set1.begin(); it1 != set1.end(); it1++)
	{
 if (*it1 == *it2)
/*
--------------------------------------------------------------------------------------------------------------------------
| 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.
@AlexMeow
AlexMeow / guessNumber.py
Last active December 28, 2018 15:36
simple number guessing game with python.
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')
/*
--------------------------------------------------------------------------------------------------------------------------
| 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);