Skip to content

Instantly share code, notes, and snippets.

//
// O(1) Time Complexity, O(1) Space complexity
const push = (array: number[], num: number): number[] => {
array[array.length] = num;
return array;
};
// O(1) Time Complexity, O(1) Space complexity
const pop = (array: number[]): number[] => {
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
html, body {

COMPLETE THE FOLLOWING TASKS!

  1. Return the customer IDs of customers who have spent at least $110 with the staff member who has an ID of 2. The answer should be customers 187 and 148.

  2. How many films begin with the letter J? The answer should be 20.

  3. What customer has the highest customer ID number whose name starts with an 'E' and has an address ID lower than 500?

DROP TABLE IF EXISTS Stock;
 
CREATE TABLE Stock (
	Id         INTEGER PRIMARY KEY,
	Ticker     TEXT    NOT NULL,
	FullName   TEXT    NOT NULL,
	TradingDay TEXT    NOT NULL,
	Price      REAL    NOT NULL CHECK (Price > 0)
);
DROP TABLE IF EXISTS employee;
DROP TABLE IF EXISTS department;
DROP TABLE IF EXISTS location;
DROP TABLE IF EXISTS country;
DROP TABLE IF EXISTS job;
 
CREATE TABLE country (
	country_id   TEXT    NOT NULL,
	country_name TEXT    NOT NULL,
@QuocCao-dev
QuocCao-dev / 1.md
Last active June 25, 2023 13:32
Array_Object_Loops

1

We have a user profile with a name, lastname, age, profession and salary. And we want to console log everything just like:

"My name is xxx xxx, i'm xxx years old. I work as xxx and make $xxx."

2

@QuocCao-dev
QuocCao-dev / 1.md
Created June 15, 2023 10:22
New Feature

1. Object Literals

Refactor the code:

var name = "Francis";
var lastname = "Jones"
var age = 23;
var obj
function createObject(name,lastname,age){
 obj = {
@QuocCao-dev
QuocCao-dev / 1.Basic-Type.txt
Last active May 6, 2024 16:40
Typescript Exercises
/* *-*-*-*-*-*-*-*-*-*-* Challenge 1 ------------------
Create a variable with the type number and assign it an arbitrary value
*/
// ----------------------------------------------------
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// ----------------------------------------------------
/* *-*-*-*-*-*-*-*-*-*-* Challenge 2 ------------------
Create a variable with the type string and use the addition operator to put two arbitrary words together
*/