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
| """ | |
| 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 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
| """ | |
| 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 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
| """ | |
| 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 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
| """ | |
| 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 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
| """ | |
| 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 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
| """ | |
| 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 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
| // 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") | |
| } |
OlderNewer