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
#!/bin/bash | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
brew update | |
brew install --cask iterm2 | |
brew install wget | |
brew install --cask spotify | |
brew install --cask spotify-notifications |
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
package main | |
import "fmt" | |
import "strings" | |
func main() { | |
update("test-name", []{"OH", "CA"}) | |
} | |
func update(name string, state []string) { |
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
require 'uri' | |
require 'net/http' | |
def get_server_connection(arg1, arg2) | |
http = nil | |
retries = 0 | |
uri = URI("http://localhost:8089/") | |
begin |
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 findSequence(vector<int> v) { | |
unordered_set<int> hashSet; | |
for(auto i = v.begin(); i != v.end(); i++) { | |
hashSet.insert(*i); | |
} |
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<iostream> | |
#include <vector> | |
using namespace std; | |
vector<int> findDuplicates(int arr[], int len) { | |
vector<int> result; | |
for(int i = 0; i < len; i++) { | |
int index = abs(arr[i]) - 1; |
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 <iostream> | |
using namespace std; | |
void printMatrix(int **matrix, int r, int c) { | |
for (int i = 0; i < r; i++) { | |
for (int j = 0; j < c; j++) | |
cout << matrix[i][j] << " "; | |
cout << endl; | |
} |
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
# Program to find median of two sorted arrays | |
def findMedianFaster(arr_a, arr_b, start_a, end_a, start_b, end_b): | |
# first base case of both arrays having 2 elements | |
if (end_a - start_a) == 1 and (end_b - start_b) == 1: | |
m1 = max(arr_a[start_a], arr_b[start_b]) | |
m2 = min(arr_a[end_a], arr_b[end_b]) | |
return (m1+m2)/2 | |
# Second base case | |
# Medians are equal in both the arrays |
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
def register(func): | |
print("hello sir!") | |
def another(): | |
┆ print("hello sir!") | |
┆ func() | |
return another | |
@register1 | |
def test(): | |
print("I am a test function") |
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 sys | |
def isNumber(s): | |
for i in range(len(s)): | |
┆ if s[i] == '-': | |
┆ ┆ try: | |
┆ ┆ ┆ if not s[i+1].isdigit(): | |
┆ ┆ ┆ ┆ return False | |
┆ ┆ except Exception: |