Skip to content

Instantly share code, notes, and snippets.

View raghavddps2's full-sized avatar
🎯
Focusing

Raghav Maheshwari raghavddps2

🎯
Focusing
View GitHub Profile
import os
import json
import base64
import asyncio
import websockets
from fastapi import FastAPI, WebSocket, Request
from fastapi.responses import HTMLResponse
from fastapi.websockets import WebSocketDisconnect
from twilio.twiml.voice_response import VoiceResponse, Connect, Say, Stream
import boto3
@raghavddps2
raghavddps2 / Solution.java
Created September 21, 2024 21:34
Validate Binary Search Tree - Leetcode #98
class Solution {
public boolean isValidBST(TreeNode root) {
return isValidBST(root, null, null);
}
/**
The key to solving this problem is that, we use low and high values and not
just depend on making sure that a particular node is greater than or less than its parent.
*/
public boolean isValidBST(TreeNode root, Integer low, Integer high) {
{
"name": "Raghav",
"gender": "",
"email":"",
"imageUrls":[
"", "", ""
],
"tagsApplicable":["A", "B", "C"],
"socialFootprint":{
"twitter":[
interface Vehicle
- double calculateCo2Emission(Trip t)
class Car implements Vehicle
- double calculateCo2Emission(Trip t)
* valueFromHashMap * t.distanceInKm
class Train implements Vehicle
- double calculateCo2Emission(Trip t)
* valueFromHashMap * t.distanceInKm
class Bus implements Vehicle
import java.util.Scanner;
import java.util.*;
public class Main{
public static boolean checkPallindrome(int num){
int actualNum = num;
int reverseNum = 0;
public String generateOrderId(OrderDetails orderDetails){
StringBuilder sb = new StringBuilder();
if(orderDetails.getIsOneDayDelivery().equals("Y") || orderDetails.getIsOneDayDelivery().equals("Yes")){
sb.append("#Y");
sb.append(String.valueOf((int)(orderDetails.getOrderedItemType().charAt(0))));
sb.append(String.valueOf((int)(orderDetails.getOrderedItem().charAt(0))));
}
else{
import requests
def maskDataUpdate():
url = "localhost:5000/realtimeMask"
payload = {
"people_with_mask":20,
"people_without_mask":14
}
function getFiles(){
return new Promise((resolve,reject)=> {
exec("ls -la", (error, stdout, stderr) => {
let fileNameArr = []
if(error){
console.log(`error : ${error.message}`);
return;
}
if(stderr){
import logo from './logo.svg';
import './App.css';
import React, { useState } from 'react';
function App() {
const [tweets,setData] = useState([""])
const onclick = (e) => {
const newData = [...tweets,""]
@raghavddps2
raghavddps2 / Resources.md
Created April 16, 2021 19:49
This is a single file for all the required links during the webinar on Introduction to API's