Skip to content

Instantly share code, notes, and snippets.

View prithajnath's full-sized avatar

Prithaj Nath prithajnath

View GitHub Profile
import mechanize
import time
browser = mechanize.Browser()
print("EZ Verizon SMS Spammer \n")
x=0
numbofmessages = int(input("How many times do you want this message sent? "))
to = raw_input("To: ")
verizon = "@vtext.com"
def depthFirstSearch(problem):
"""
Search the deepest nodes in the search tree first.
Your search algorithm needs to return a list of actions that reaches the
goal. Make sure to implement a graph search algorithm.
To get started, you might want to try some of these simple commands to
understand the search problem that is being passed in:
#!/bin/python
import sys
from collections import deque
def gen_nbrs(node,move,n):
x,y = move[0],move[1]
nbr = []
for i in [('+','-'),('-','+'),('-','-'),('+','+')]:
a,b = node[0],node[1]
if i[0] == '-':
a = a - x
def shopSmart(orderList, fruitShops):
"""
orderList: List of (fruit, numPound) tuples
fruitShops: List of FruitShops
"""
"*** YOUR CODE HERE ***"
costs = {}
for i in fruitShops:
cost = 0
for j in xrange(len(orderList)):
points = {1.047:1.139,2.005:2.087,3.348:3.413,5.719:5.765,7.273:7.304,8.41:8.426,9.117:9.127}
avg,slopes = 0.0,set()
for i in points:
for j in points:
if i!=j and (i,j) not in slopes:
avg = avg + float(points[j]-points[i])/float(j-i)
slopes.add((i,j))
print avg/float(len(points))
# Prithaj
# Problem URL : https://www.hackerrank.com/challenges/rust-murderer
from collections import deque
T = input()
# BFS
def return_nodes(N,a,edges):
for i in xrange(1,N+1):
if i != a and (i,a) not in edges and (a,i) not in edges:
yield i