Skip to content

Instantly share code, notes, and snippets.

View yovasx2's full-sized avatar

Giovanni Alberto yovasx2

  • Vela Inc.
  • Querétaro
View GitHub Profile
#!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
# 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))])
@yovasx2
yovasx2 / solution.rb
Last active February 12, 2021 18:37
screening interview: queue using restricted size arrays
# 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
@yovasx2
yovasx2 / solution.rb
Last active February 12, 2021 18:37
screening interview: get all the combinatiosn of the menu that get the target budget
# "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"]]
// 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");