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
| #! /usr/bin/python3 | |
| import concurrent.futures | |
| from math import floor, sqrt | |
| import time | |
| def is_prime(number: int) -> bool: | |
| if not (number & 1): return 0 | |
| iteration = floor(sqrt(number)) + 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
| #! /usr/bin/python3 | |
| from math import floor, sqrt | |
| import time | |
| def is_prime(number: int) -> bool: | |
| if not (number & 1): return 0 | |
| iteration = floor(sqrt(number)) + 1 | |
| for i in range(3, iteration, 2): |
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
| #include <ESP8266WiFi.h> | |
| #include <PubSubClient.h> | |
| // Relays | |
| #define RelayPin1 D5 // D5 | |
| #define RelayPin2 D2 // D2 | |
| #define RelayPin3 D0 // D0 | |
| #define RelayPin4 D6 // D6 |
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
| #! /usr/bin/python | |
| # Too Much Time Consuming For Big Size Input | |
| # Because of for 31st line condition | |
| # As List takes O(n) time with "in" operator | |
| # Dictionary can be used instead of "direction_list" List | |
| # As Dictionary takes O(1) time to check |
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
| #!/usr/bin/python3 | |
| input_string = "abcabcbb" | |
| starting_idx = 0; max_length = 0; length = 0 | |
| i,j=0,0 | |
| for i in range(len(input_string)): | |
| for j in range(i-1, starting_idx-1, -1): | |
| if (input_string[j] == input_string[i]): | |
| starting_idx = j + 1 | |
| length = i - j |
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
| <?php | |
| /** | |
| * php-imagick is required : sudo apt-get install php-imagick | |
| * | |
| */ | |
| $file = "Pic/003960.jpg"; // tif file named in jpg extension | |
| // $file = "Pic/003958.jpg"; // orgnial jpg format |
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
| #!/usr/bin/python | |
| from pexpect import pxssh | |
| s = pxssh.pxssh() | |
| hostname = '' | |
| username = '' | |
| password = '' | |
| if not s.login (hostname, username, password): |
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
| d = { | |
| (1, 1): (0, -1), | |
| (1, -1): (0, 1), | |
| (-1, 1): (-1, 0), | |
| (-1, -1): (1, 0) | |
| } | |
| def getFirstPosition(n): | |
| pass |
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 math import floor | |
| from math import sqrt | |
| def getPrimeNum(num): | |
| mylist = [1] * num | |
| mylist[0], mylist[1], mylist[2] = 0, 0, 1 | |
| for i in range(4, num, 2): | |
| mylist[i] = 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
| s = ['Happy', 'birthday', 'to', 'you', 'Happy', 'birthday', 'to', 'you', 'Happy', 'birthday', 'to', 'Rujia', 'Happy', 'birthday', 'to', 'you'] | |
| member = int(input().strip()) | |
| arr = [input().strip().capitalize() for i in range(member)] | |
| j,p = 0,0 | |
| if member < 16: | |
| iterate = 16 | |
| else: | |
| iterate = member |