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
#!usr/bin/ruby | |
# The night sky can be modeled as an infinite 2D plane. There are N stars at distinct positions on this plane, the ith of which is at coordinates (Xi, Yi). | |
# A boomerang constellation is a pair of distinct equal-length line segments which share a single endpoint, such that both endpoints of each segment coincide with a star's location. | |
# Two boomerang constellations are distinct if they're not made up of the same unordered pair of line segments. How many distinct boomerang constellations can you spot? | |
# Input Format |
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
# TODO: Define your network architecture here | |
import torch | |
from torch import nn | |
from torch import optim | |
from torchvision import datasets, transforms | |
import helper | |
# Define a transform to normalize the data | |
transform = transforms.Compose([transforms.ToTensor(), | |
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) |
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
# Build a queue class with the enqueue and dequeue methods. | |
# The queue can store an *UNLIMITED* number of elements but you are limited to using arrays that can store up to 5 elements max | |
# 1# [3,4,5] 2# [6,7,8,9,10] 3# [11,12,13] | |
# [1#, 2#, 3#, 4#, 5#] [6#, ] | |
class Node | |
SIZE_LIMIT = 5.freeze | |
attr_accessor :value | |
attr_accessor :_next |
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
# "Fruit": 2.15, | |
# "Fries": 2.75, | |
# "Salad": 3.35, | |
# "Wings": 3.55, | |
# "Mozzarella": 4.20, | |
# "Plate": 5.80, | |
# 4.30 -> [["Fruit", "Fruit"]] | |
# possibleOrders(5.50) -> [["Fries", "Fries"], ["Fruit", "Salad"]] |
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
// Create the iframe element | |
var iframe = document.createElement("iframe"); | |
// Set the source URL for the iframe | |
iframe.src = "https://www.example.com"; | |
// Set any additional attributes or styles for the iframe | |
iframe.setAttribute("width", "100%"); | |
iframe.setAttribute("height", "400px"); | |
iframe.setAttribute("frameborder", "0"); |
OlderNewer