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
| """ | |
| this program generates a random number block and prints it | |
| """ | |
| import random | |
| class NumberBlock: | |
| # 1 - 2 - 3 | |
| # | | | |
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
| # %% | |
| from sympy import plot_implicit, symbols, Eq | |
| from matplotlib import pyplot as plt | |
| import numpy as np | |
| x, y = symbols("x y") | |
| def plot(equation, x_range, y_range, width=5, height=5, show=True): | |
| p = plot_implicit( |
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
| 1-st pouring | |
| n=1 | |
| 0.500 | |
| 2-nd pouring | |
| n=2 | |
| 1 | |
| 0.500 0.500 |
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
| /** @format */ | |
| import { PrismaClient } from "@prisma/client"; | |
| import { Batch, Product } from "./app.model"; | |
| import { IProductRepository } from "./app.repository"; | |
| import { AppService } from "./app.service"; | |
| import { AbstractUnitOfWork, PrismaUnitOfWork } from "./unitOfWork"; | |
| class FakeProductRepository implements IProductRepository { | |
| constructor(private batches: Batch[]) {} |
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
| # โจทย์ | |
| # ---- | |
| # ลืมรหัสเข้า app บนมือถือจำได้แค่เพียงว่ารหัสมี 4 หลัก ขึ้นต้นด้วยเลข 6 และหารด้วย 69 และ 96 ลงตัว | |
| # คำถามคือรหัสผ่านคืออะไร | |
| # ที่มาของโจทย์: asiamediasoft | |
| def find_forgotten_passcode(): | |
| set_a = {i for i in range(6000, 7000) if i % 69 == 0} | |
| set_b = {i for i in range(6000, 7000) if i % 96 == 0} |
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
| # โจทย์ | |
| # ---- | |
| # หนังสือเล่มหนึ่งมีเลขหน้าระบุไว้ทุกแผ่นโดยเริ่มจากหน้าที่ 1 โดยหนังสือมีหน้ากระดาษอยู่หนึ่งแผ่นที่ขาดหายไป และเมื่อผลรวมของเลขหน้าทุกหน้าที่เหลือยู่ได้ผลรวมเป็น 999 | |
| # หน้ากระดาษที่หายไปคือหน้าอะไร | |
| # ที่มาของโจทย์: asiamediasoft | |
| # ตีโจทย์ | |
| # ---- | |
| # ให้ p คือหน้าสุดท้ายของหนังสือ s คือผลรวมของหน้าที่เหลืออยู่ (จากโจทย์คือ 999) และ m คือหน้าที่หายไป |
NewerOlder