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
// HTML | |
<html> | |
<head> | |
<link rel="stylesheet" href="./src/styles.css"> | |
</head> | |
<body> | |
<h1></h1> | |
<div> | |
<div> | |
<h2>Click start to play!</h2> |
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
//Challenge 1 | |
function cartPrice(items){ | |
let totalCost =0; | |
for (let i =0; i< items.length; i++){ | |
totalCost += items[i].price | |
} | |
return totalCost; | |
} |
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> | |
<!-- CSS only --> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" | |
rel="stylesheet" | |
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" | |
crossorigin="anonymous"> | |
<!-- Required meta tags --> | |
<meta charset="utf-8" /> |
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
///////////Solution.js | |
function findStudentScoreByName(students, name) { | |
for (let person in students){ | |
let item = students[person] | |
if (item.name === name){ | |
return item.score | |
} | |
} |
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
//Solution.js | |
function partitionStudentsByScore(students, score) { | |
const result = [] | |
const target = [] | |
const excess = [] | |
students.forEach(student => { | |
student.score <= score ? target.push(student) : excess.push(student) | |
}) | |
result.push(target, excess) |
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
////////////PArkingLot.js | |
const Queue = require("../queue/queue"); | |
/** | |
* Implement a Parking Lot. | |
* | |
*/ | |
class ParkingLot { | |
constructor(capacity, rate) { | |
this.spaces = new Array(capacity).fill("vacant"); |
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
//// PlayStop.js | |
import React from "react"; | |
import classNames from "../utils/class-names"; | |
function PlayStop ({ isTimerRunning, disableBtn, playPause, handleStop }) { | |
return ( | |
<div className="row"> | |
<div className="col"> | |
<div |
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
//Binary.js | |
const Queue = require("./lib/queue"); | |
const binary = (max) => { | |
const array = ["1", "10", "11", "100", "101"] | |
return array.slice(0, max) | |
}; | |
module.exports = binary; |
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
function missing1(A) { | |
const N = A.length + 1 | |
for ( let i = 1; i <= N; i++) { | |
let found = false | |
let j = 0 | |
while (found === false && j < A.length) { | |
if (i === A[j]) { | |
found = true | |
} | |
j++ |
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.js | |
import React, { useEffect, useState } from "react" | |
import "./App.css" | |
import AlbumList from "./AlbumList" | |
import UserList from "./UserList" | |
function App() { | |
const [users, setUsers] = useState([]) |
NewerOlder