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 scrapy | |
| class HackerrankSpider(scrapy.Spider): | |
| name = 'hackerrank' | |
| start_urls = ['http://www.hackerrank.com/login'] | |
| def parse(self, response): | |
| form = {'login': 'myUserName', 'password': 'secret'} |
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
| char = ['a', 'b', 'c', 'd', 'e', 'f'] | |
| freq = [5, 9, 12, 13, 16, 45] | |
| class Node: | |
| def __init__(self, data, char=None): | |
| self.data = data | |
| self.char = char | |
| self.head = data | |
| self.left = None |
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
| # the problem is not solved yet | |
| from itertools import product | |
| k, m = map(int, input().split()) | |
| li = [] | |
| for _ in range(k): | |
| pagli = list(map(int, input().split())) | |
| pagli.pop(0) |
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
| def checkAnswer(x, y): | |
| c = 0 | |
| for i in range(m): | |
| if x[i] or y[i]: | |
| c += 1 | |
| return c | |
| n,m = map(int, input().split()) | |
| topic = [] | |
| count=0; maxim = -1 |
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
| def checkPath(row, col): | |
| li = [] | |
| if row-1 >= 0 and not ar[row-1][col]: | |
| ar[row-1][col] = ar[row][col] + 1 | |
| li.append([row-1, col]) | |
| if col-1 >= 0 and not ar[row][col-1]: | |
| ar[row][col-1] = ar[row][col] + 1 | |
| li.append([row, col-1]) | |
| if row+1 < 8 and not ar[row+1][col]: | |
| ar[row+1][col] = ar[row][col] + 1 |
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
| for nothing in range(int(input().strip())): | |
| n, first = map(int, input().split()) | |
| sec = first | |
| for _ in range(n): | |
| d = input().split() | |
| if d[0]=='P': | |
| first = sec | |
| sec = d[1] | |
| elif d[0]=='B': | |
| sec, first = first, sec |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
| <meta charset="utf-8"> | |
| <title>Marker Clustering</title> | |
| <style> | |
| /* Always set the map height explicitly to define the size of the div | |
| * element that contains the map. */ | |
| #map { |
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
| # not yet solved | |
| # a test case: 15 5 2 3 | |
| n, a, b, c = map(int, input().split()) | |
| a, b, c = sorted([a,b,c]) | |
| p, q, r = (n//a)+1, (n//b)+1, (n//c)+1 | |
| maximum = -1 | |
| for i in range(r): |
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 socket | |
| import random | |
| import time | |
| import sys | |
| log_level = 2 | |
| def log(text, level=1): | |
| if log_level >= level: | |
| print(text) |
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 bs4 import BeautifulSoup | |
| from selenium import webdriver | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions as ec | |
| from selenium.webdriver.common.by import By | |
| from selenium.common.exceptions import TimeoutException | |
| import csv | |
| import time |
OlderNewer