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 urllib.request as req | |
import json | |
base_url="https://challenges.hackajob.co/swapi/api/" | |
film_search_url=base_url+"films/?search=" | |
people_search_url=base_url+"people/?search=" | |
class Solution: | |
def run(self, film, character): | |
#films by character | |
films_char=None |
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
class Solution: | |
def run(self, morseToEnglish, textToTranslate): | |
correlation = {'A': '.-', 'B': '-...', 'C': '-.-.', | |
'D': '-..', 'E': '.', 'F': '..-.', | |
'G': '--.', 'H': '....', 'I': '..', | |
'J': '.---', 'K': '-.-', 'L': '.-..', | |
'M': '--', 'N': '-.', 'O': '---', | |
'P': '.--.', 'Q': '--.-', 'R': '.-.', | |
'S': '...', 'T': '-', 'U': '..-', | |
'V': '...-', 'W': '.--', 'X': '-..-', |
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
<?php | |
function run($teamKey) | |
{ | |
/* | |
* Some work here; return type and arguments should be according to the problem's requirements | |
*/ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://raw.githubusercontent.com/openfootball/football.json/master/2014-15/en.1.json"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
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
<?php | |
function run($n, $m, $movies) { | |
$init_array=range(1,$n); | |
$to_out=[]; | |
foreach ($movies as $mov){ | |
$key=array_search($mov,$init_array); | |
if($key==0){ | |
array_push($to_out,($key)); | |
}else{ | |
array_push($to_out,($key)); |
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
pip install plaidml plaidml-keras plaidbench keras | |
pip install tensorflow | |
plaidml-setup |
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
function fizzBuzz($n) { | |
$output=[]; | |
foreach (range(1,$n,1) as $val){ | |
if(($val % 5)==0 and ($val % 3)==0){ | |
$output[]="FizzBuzz"; | |
}elseif (($val % 3)==0){ | |
$output[]="Fizz"; | |
}elseif (($val % 5)==0){ | |
$output[]="Buzz"; | |
}else{ |
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
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" /> | |
</head> | |
<body style="margin: 0;"> | |
<div id="app"></div> | |
</body> | |
</html> |
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
def fizzBuzz(n): | |
output=[] | |
for val in range(1,n+1,1): | |
if((val % 5)==0 and (val % 3)==0): | |
output.append("FizzBuzz") | |
elif ((val % 3)==0): | |
output.append("Fizz") | |
elif ((val % 5)==0): | |
output.append("Buzz") | |
else: |
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
# you can write to stdout for debugging purposes, e.g. | |
# print("this is a debug message") | |
def flip(c): | |
return 1 if (c == 0) else 0 | |
def do_flips(A,exc): | |
cnt=0 | |
for i,x in enumerate(A): | |
if x!=exc: | |
cnt+=1 |
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: Ian Muge | |
Date: | |
""" | |
import multiprocessing,threading,collections,itertools,hashlib,time | |
from pprint import pprint | |
""" | |
Base functions | |
""" |
OlderNewer