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
#6/30/16 | |
#https://www.hackerrank.com/challenges/sets/forum | |
raw_input() | |
n1 = set(map(int,(raw_input().split()))) | |
raw_input() | |
n2 = set(map(int,(raw_input().split()))) | |
u = n1.symmetric_difference(n2) |
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
#7/1/16 | |
#https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list | |
int(raw_input()) | |
n = map(int,raw_input().split()) | |
maxi = max(n) |
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
#https://www.hackerrank.com/challenges/nested-list | |
#7/2/16 | |
n = int(raw_input()) | |
student = [] | |
for i in range(n): | |
student.append([raw_input(),float(raw_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
#7/2/16 | |
#https://www.hackerrank.com/challenges/swap-case | |
s = [i.lower() if i.isupper() else i.upper() for i in raw_input()] | |
print ''.join(s) |
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
#7/2/16 | |
#https://www.hackerrank.com/challenges/itertools-product | |
from itertools import product | |
a = map(int,raw_input().split()) | |
b = map(int,raw_input().split()) |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "statement1", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::acct:user/devuser" | |
}, | |
"Action": [ |
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
#07/10/16 | |
#https://www.hackerrank.com/challenges/find-a-string | |
s1 = raw_input() | |
s2 = raw_input() | |
tam = len(s2) | |
c = 0 | |
for i in range(0,len(s1)): | |
if s1[i] == s2[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
#7/15/16 | |
#https://www.hackerrank.com/challenges/text-alignment | |
ti = int(raw_input()) #an odd number | |
c = '@' | |
w = ' ' | |
#Top | |
for i in range(ti): |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen | |
based on the region in which the stack is run. This example creates an EC2 security group for the instance | |
to give you SSH access.", | |
"Parameters" : { | |
"KeyName": { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", |
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
#08/1/16 | |
#https://www.hackerrank.com/challenges/designer-door-mat | |
N, M = map(int,input().split()) # More than 6 lines of code will result in 0 score. Blank lines are not counted. | |
for i in range(1,N,2): | |
print ((i*".|.").center(M,"-")) | |
print ("WELCOME".center(M,"-")) | |
for i in range(N-2,-1,-2): | |
print ((i*".|.").center(M,"-")) |