Skip to content

Instantly share code, notes, and snippets.

View Abdujabbar's full-sized avatar
🏠
Working from home

Abdujabbar Mirkhalikov Abdujabbar

🏠
Working from home
  • Self Employment
  • Tashkent
View GitHub Profile
@Abdujabbar
Abdujabbar / test.php
Last active October 31, 2015 23:11
php
<?php
define('DARYO_ANDROID_REG_IDS', 'daryo_android_reg_ids');
define('DARYO_PUSH_API_KEY', 'daryo-push-key');
define('PLUGIN_PATH', dirname(__FILE__) . '/');
define('DARYO_PUSH_BULK_SIZE', 300);
define('DARYO_PUSH_SLEEP_TIME', 5);
if (count($argv) < 2) {
exit();
}
@Abdujabbar
Abdujabbar / py
Created November 24, 2015 21:16
Morgan and String
__author__ = 'abdujabbor'
def find_lex_min_string(s1, s2):
result = ''
i = 0
j = 0
while i < len(s1) and j < len(s2):
if s1[i:] < s2[j:]:
result += s1[i]
t = int(input())
for i in range(t):
n = int(input())
a = [int(x) for x in input().split()]
_sum = a[0]
t = int(input())
for i in range(t):
n = int(input())
a = [int(x) for x in input().split()]
_sum = a[0]
@Abdujabbar
Abdujabbar / bfs
Last active January 29, 2016 12:27
BFS
def bfs(g, start):
distance = [0] * len(g)
queue = []
queue.append(start - 1)
distance[start - 1] = 0
while len(queue) != 0:
current = queue.pop(0)
for i in g[current]:
if distance[i] == 0:
@Abdujabbar
Abdujabbar / py
Created February 1, 2016 07:12
flatland space stations
__author__ = 'abdujabbor'
n, m = [int(x) for x in input().split()]
lst = [0] * n
zeros = sorted([int(x) for x in input().split()])
lz = len(zeros)
if len(zeros) == n:
print(0)
else:
for i in range(lz):
@Abdujabbar
Abdujabbar / py
Created February 1, 2016 07:13
mars-esploration
__author__ = 'abdujabbor'
s = input()
pattern = 'SOS'
counter = 0
for i in range(0, len(s), 3):
curr = s[i:i + 3]
found = 0
for t in range(len(pattern)):
if pattern[t] == curr[t]:
@Abdujabbar
Abdujabbar / py
Created February 1, 2016 07:13
build a string
__author__ = 'abdujabbor'
t = int(input())
for i in range(t):
n, a, b = [int(x) for x in input().split()]
s = input()
r = s[0]
j = 1
aa = min(a, b)
bb = max(a, b)
@Abdujabbar
Abdujabbar / python
Created May 6, 2016 06:38
stepic solution
import requests
import re
a = input()
b = input()
counter = 0
r = requests.get(a)
@Abdujabbar
Abdujabbar / python
Created May 6, 2016 13:44
stepic python
import csv
import operator
from datetime import datetime
def validate_date(d):
try:
datetime.strptime(d, r'%m/%d/%Y %H:%M:%S %p')
return True
except ValueError:
return False