This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// MultiplyX | |
// | |
// Created by Pratik Anand on 02/12/13. | |
// Copyright (c) 2013 Pratik Anand. All rights reserved. | |
// | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// simple.c | |
// MultiplyX | |
// | |
// Created by Pratik Anand on 02/12/13. | |
// Copyright (c) 2013 Pratik Anand. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// MultiplyX | |
// | |
// Created by Pratik Anand on 02/12/13. | |
// Copyright (c) 2013 Pratik Anand. All rights reserved. | |
// | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rubik | |
import unittest | |
def shortest_path(start, end): | |
""" | |
Using 2-way BFS, finds the shortest path from start_position to | |
end_position. Returns a list of moves. | |
You can use the rubik.quarter_twists move set. | |
Each move can be applied using rubik.perm_apply | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def reading_input(file, teja): | |
with open(file) as w: | |
content = w.readlines() | |
ctr = 0 | |
boomerangs = [] | |
nights = content[0] #ignoring this value as we can print without nights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source : http://www.geeksforgeeks.org/maximum-product-subarray/ | |
def maxProd(input): | |
prod = temp_prod = 1 | |
i=0 | |
negativeCount = 1 | |
start_SubArray = -1 | |
end_SubArray = -1 | |
while i < len(input) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code is based on needle.c for Needleman-Wunsch algorithm at | |
// https://github.com/vtsynergy/OpenDwarfs/blob/master/dynamic-programming/nw/needle.c | |
#define LIMIT -999 | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include "needle.h" | |
#include <sys/time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# Author : Pratik Anand # | |
########################## | |
from sets import Set | |
from math import log | |
from decimal import * | |
from tabulate import tabulate | |
import copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# Author : Pratik Anand # | |
########################## | |
from tabulate import tabulate | |
import copy | |
class Obj : | |
data = 0 | |
x = 0 | |
y = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# Author : Pratik Anand # | |
########################## | |
from tabulate import tabulate | |
import copy | |
IS_LOCAL_ALIGNMENT = False | |
USE_BLOSUM = False | |
match = 1 | |
mismatch = -1 |
OlderNewer