Skip to content

Instantly share code, notes, and snippets.

View anurag-7's full-sized avatar
👋
howdy

Anurag anurag-7

👋
howdy
  • Middle of nowhere, India
View GitHub Profile
@anurag-7
anurag-7 / suite.py
Last active January 13, 2025 12:17
class Suite:
def __init__(self, failing: tuple[int, int]):
self.failing = set(failing)
def testSuite(self, arr: list[int]):
return len(set(arr) & self.failing) == 2
def solve(self, n: int):
arr = list(range(n))
result = self.dnc(arr)
@anurag-7
anurag-7 / py
Created May 28, 2024 09:44
Finding the longest word which is still a word with a character removed
import json
# Dataset used https://github.com/dwyl/english-words/blob/master/words_dictionary.json
with open(r'path/to/words_dictionary.json') as f:
words = json.load(f)
longest_len = 0
longest_word = ""
Time Side Instrument OptionType
09:18:39.184.112.574 Buy HDFCLIFE20DEC660PE PE
09:40:45.724.619.778 Sell BEL20DEC110PE PE
09:40:45.725.883.078 Sell BEL20DEC112.5PE PE
10:08:14.993.269.799 Buy BANKBARODA20DEC63CE CE
10:09:11.452.614.025 Buy ITC20DEC200CE CE
10:19:25.134.812.941 Buy FEDERALBNK20DEC66CE CE
10:26:40.232.194.477 Buy MANAPPURAM20DEC175PE PE
10:27:13.855.205.646 Buy TATACONSUM20DEC540PE PE
10:32:43.153.077.655 Buy APOLLOHOSP20DEC2400PE PE
@anurag-7
anurag-7 / bad_ping_bot.py
Last active April 21, 2021 06:39
Just works
import discord as a;b,c=a.Client(),int
@b.event
async def on_message(a):e=a.embeds;return(await a.channel.send(f"{e[0].title} Spawned | <@&role_id>"),None)[e and e[0].image and a.author.id==673362753489993749 and c(e[0].title[-1])>3]
b.run('Token')
import asyncio
import contextlib
import heapq
import types
__all__ = ('PrioritySemaphore')
class PrioritySemaphore(asyncio.Semaphore):
@anurag-7
anurag-7 / timer.py
Last active October 21, 2020 10:51
Before Using this Script, Install Python 3.5.3+ and Discord.py beforehand.
import asyncio
import logging
import time
from contextlib import suppress
from typing import Union
import discord
"""