Skip to content

Instantly share code, notes, and snippets.

View ABcDexter's full-sized avatar
💭
reSearching...

AnubhavB ABcDexter

💭
reSearching...
View GitHub Profile
@ABcDexter
ABcDexter / PALIN.py
Created August 16, 2024 19:02
SPOJ code for PALIN
#AnubhavBalodhi, SPOJ, PALIN, 16/08/2024
def nextPalin(num :str ) -> str:
odd_or_not = len(num)%2
h_len = len(num)//2
full = [int(c) for c in num]
@ABcDexter
ABcDexter / puzzle.py
Created May 16, 2021 10:00 — forked from rep-movsd/puzzle.py
Word puzzle checker
#/usr/bin/python
import sys
import json
# open grid file
with open(sys.argv[1]) as f:
lines = [line.rstrip('\n') for line in f]
# make the grid but padded on left right and bottom sides with a sentinel like this (makes it easy to grab diagonals)
@ABcDexter
ABcDexter / homework.ipynb
Created September 29, 2020 11:57
Pandas basic code,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ABcDexter
ABcDexter / principal_component_analysis.ipynb
Created August 19, 2017 10:21 — forked from infinite-Joy/principal_component_analysis.ipynb
description for principal component analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ABcDexter
ABcDexter / tmux-cheatsheet.markdown
Created August 3, 2017 09:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ABcDexter
ABcDexter / isPow2.py
Created November 14, 2016 07:11
Check whether a given positive integer N is power of 2 or not in log(N) complexity.
def isPow2(num):
rem=num%2
while num>1:
if rem==1:
return False
rem=num%2
num/=2
if num>1:
return False
else:
#AnubhavBalodhi, Puzzling.SE, 7804, 23216, 314...
N=int(input())
for num in range(N):
for X in range(2,N-8):
if (8*((num*(num+1)-8*(X+3))))==(825*(num-4)):
print(X,num)
#BeDaBe(a)st