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
| def itemsSort(items): | |
| sortedByValue = sorted(items) | |
| inventory = {} | |
| for value in sortedByValue: | |
| if value not in inventory: | |
| inventory[value] = 1 | |
| elif value in inventory: | |
| inventory[value] += 1 | |
| listOfLists = [] | |
| for item, quantity in inventory.items(): |
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
| /* | |
| * Algorithm | |
| * | |
| * Data structures: Array | |
| * 1. concatenate n, k times to create p | |
| * 2. iterate through p to find the sum of all individual integers in p | |
| * 3. iterate through sum of p to find the sum of all individual integers | |
| * 4. repeat until length of p is less than 2, then return p | |
| * | |
| */ |
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 string | |
| from collections import Counter | |
| def getTime(s): | |
| #set up | |
| dictionary = Counter(string.ascii_uppercase) | |
| num = 1 | |
| for letter in dictionary: | |
| dictionary[letter] = num | |
| num += 1 |
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
| /** | |
| returns whether roomba ever hits the starting point facing the starting direction | |
| (0, 0) is the (x, y) starting point, facing right | |
| moves is an even length array | |
| even indexes are amount to move | |
| odd indexes are either R or L to rotate 90 degrees right or left | |
| */ |
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
| def newPassword(a, b): | |
| newWord = "" | |
| for char in range(len(a)): | |
| newWord += a[char] | |
| newWord += b[char] | |
| return newWord |
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 React, { useEffect, useState } from "react"; | |
| import axios from "axios"; | |
| function UserCard({ userId }) { | |
| const [user, setUser] = useState(null); | |
| const [loading, setLoading] = useState(true); | |
| useEffect(() => { | |
| const fetchUser = async () => { | |
| try { | |
| setLoading(true); | |
| const { data } = await axios.get( |
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> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
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> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| #coverpic{ | |
| height:610px; | |
| width:100%; | |
| } |
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> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| var yourName = prompt("What is your name?"); |
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> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| .die { | |
| border: 1px solid black; | |
| height: 75px; |
NewerOlder