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
/* | |
Given an input like 2[3[b]2[ab]], print the output as bbbabababbbbababab | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
ios_base::sync_with_stdio(false); | |
int n, b, e, k; | |
unordered_map<double, string> vals; | |
vector<double> results; |
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
/* | |
Interactive problem: | |
There are N machine of which B are broken. Each machine stores one bit | |
and sends them back. We can make upto F queries. | |
For each query we send N bits which are stored in the machines (index 0 based) | |
Then the bits are read back and given to us. The broken machines don't return anything | |
Which means we get back N-B bits. | |
Identify and print the indices of the broken machines. |
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
public class Threading { | |
public static void main(String[] args) { | |
ProducerConsumer pc = new ProducerConsumer(); | |
Runnable run_produce = () -> { | |
try { | |
pc.produce(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
}; |
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
import requests | |
from time import sleep | |
from sendgrid import SendGridAPIClient | |
from sendgrid.helpers.mail import Mail | |
SENDGRID_KEY = 'YORU-API-KEY-HERE' | |
def send_mail(): | |
message = Mail( |
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
#include <stdio.h> | |
float calcAvg(int a[], int n) | |
{ | |
int total = 0; | |
for (int i = 0; i < n; i++) | |
total += a[i]; | |
return (float)total / n; | |
} |
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
{ | |
"name": "test-project", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", |
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
const path = require('path') | |
module.exports = { | |
"entry": "./src/index.js", | |
"output": { | |
path: path.resolve(__dirname, 'dist'), | |
filename: "bundle.js" | |
}, | |
module: { | |
rules: [ |
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
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react"] | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>React App</title> | |
</head> | |
<body> | |
<div id="root"></div> |
OlderNewer