This file contains 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
// main.js - Arquivo principal do electron | |
// executado via npm start | |
const { app, BrowserWindow } = require('electron') | |
function createWindow () { | |
let win = new BrowserWindow({width: 800, height: 600}) | |
win.loadURL("http://localhost:8000/teste.html") | |
} |
This file contains 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
""" | |
This problem was asked by Google. | |
You are given an M by N matrix consisting of booleans that represents a board. Each True boolean represents a wall. Each False boolean represents a tile you can walk on. | |
Given this matrix, a start coordinate, and an end coordinate, return the minimum number of steps required to reach the end coordinate from the start. If there is no possible path, then return null. You can move up, left, down, and right. You cannot move through walls. You cannot wrap around the edges of the board. | |
For example, given the following board: | |
[[f, f, f, f], |
This file contains 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
""" | |
This problem was asked by Microsoft. | |
Given a dictionary of words and a string made up of those words (no spaces), return the original sentence in a list. If there is more than one possible reconstruction, return any of them. If there is no possible reconstruction, then return null. | |
For example, given the set of words 'quick', 'brown', 'the', 'fox', and the string "thequickbrownfox", you should return ['the', 'quick', 'brown', 'fox']. | |
Given the set of words 'bed', 'bath', 'bedbath', 'and', 'beyond', and the string "bedbathandbeyond", return either ['bed', 'bath', 'and', 'beyond] or ['bedbath', 'and', 'beyond']. | |
https://dailycodingproblem.com/ |
This file contains 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
""" | |
This problem was asked by Snapchat. | |
Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required. | |
For example, given [(30, 75), (0, 50), (60, 150)], you should return 2. | |
https://dailycodingproblem.com/ | |
""" | |
import itertools |
This file contains 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
""" | |
This problem was asked by Jane Street. | |
cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. | |
Given this implementation of cons: | |
def cons(a, b): | |
return lambda f : f(a, b) | |
Implement car and cdr. |
This file contains 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
""" | |
This problem was asked by Stripe. | |
Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well. | |
For example, the input [3, 4, -1, 1] should give 2. The input [1, 2, 0] should give 3. | |
You can modify the input array in-place. | |
https://dailycodingproblem.com/ |
This file contains 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
""" | |
This problem was asked by Google. | |
Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree. | |
https://dailycodingproblem.com/ | |
""" | |
class Node: | |
def __init__(self, value): |
This file contains 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
""" | |
This problem was asked by Uber. | |
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. Solve it without using division and in O(n) time. | |
For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6]. | |
https://dailycodingproblem.com/ | |
""" |
This file contains 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
""" | |
This problem was asked by Google. | |
Given a stack of N elements, interleave the first half of the stack with the second half reversed using only one other queue. This should be done in-place. | |
Recall that you can only push or pop from a stack, and enqueue or dequeue from a queue. | |
For example, if the stack is [1, 2, 3, 4, 5], it should become [1, 5, 2, 4, 3]. If the stack is [1, 2, 3, 4], it should become [1, 4, 2, 3]. | |
Hint: Try working backwords from the end state. |
This file contains 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/env python | |
def women_day(): | |
print(" ." + (":" * 3) + "." + (" " * 3) + "." + (":" * 3) + ".") | |
print((":" * 7) + "." + (":" * 7)) | |
print(":" * 15) | |
print("'" + (":" * 13) + "'") | |
print((" " * 2) + "'" + (":" * 9) + "'") | |
print((" " * 4) + "'" + (":" * 5) + "'") | |
print((" " * 6) + "':'") |
NewerOlder