Skip to content

Instantly share code, notes, and snippets.

View vishalkanaujia's full-sized avatar
🎯
Focusing

Vishal K vishalkanaujia

🎯
Focusing
  • Singapore
View GitHub Profile
@vishalkanaujia
vishalkanaujia / common-apps.sh
Last active August 31, 2021 23:56
Common Mac Software
#!/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
package main
import "fmt"
import "strings"
func main() {
update("test-name", []{"OH", "CA"})
}
func update(name string, state []string) {
require 'uri'
require 'net/http'
def get_server_connection(arg1, arg2)
http = nil
retries = 0
uri = URI("http://localhost:8089/")
begin
#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);
}
#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;
#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;
}
# 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
def register(func):
print("hello sir!")
def another():
┆ print("hello sir!")
┆ func()
return another
@register1
def test():
print("I am a test function")
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: