This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |
NewerOlder