Skip to content

Instantly share code, notes, and snippets.

View hinupurthakur's full-sized avatar
:shipit:
Vibing

Nupur Thakur hinupurthakur

:shipit:
Vibing
View GitHub Profile
@hinupurthakur
hinupurthakur / parenthesisChecker.go
Created February 2, 2022 14:31
To check if brackets are balanced in a string. Balanced brackets look like: “(())()”, “((()))”, “()”… Unbalanced brackets: “(((”, “())”, “(("
package main
import "fmt"
// function to check if brackets are balanced
func isBalanced(expr string) bool {
brackets := map[rune]rune{
'(': ')',
'[': ']',
'{': '}',
#include<bits/stdc++.h>
using namespace std;
long long solve (string S) {
// Write your code here
long long mod=1000000007; //10^9+7 to prevent integer overflow
S = " "+S;
int freq[30]={0};
for(int i=1;i<S.size();i++){
freq[S[i]-'a']++;
@hinupurthakur
hinupurthakur / db_connect.go
Created June 10, 2020 18:03
Postgres connecting to GoLAng
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
const (