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
const { logger } = require('./logger/log4js.config'); | |
// main function that calculates no of ones and zeros in a binary value of a number | |
const findNoOfOnesAndZeros = number => { | |
let binaryValue = 0; | |
const count = { | |
numberOfOnes: 0, | |
numberOfZeros: 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
#g = int(input()) | |
#b, h = map(int, input().split()) | |
m = pow(10,9)+7 | |
#l = list(map(int, input().split())) | |
g = 7 | |
b, h = 1, 1 | |
l = [6, 7, 3, 4, 5, 1, 3] | |
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 itertools import product | |
def Perm(num): | |
return sum([int(i) for i in num]) | |
first, second = map(int, input().split()) | |
rep = int(input()) | |
arr = [str(i) for i in range(first, second + 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
import itertools | |
n = int(input()) | |
inputs = list(map(int, input().split())) | |
max_binary_equivalence = max(inputs) | |
def Binary(n): | |
binary = [] | |
while n != 0: | |
binary.append(n % 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
n = int(input()) | |
inputs = list(map(int, input().split())) | |
from itertools import combinations | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
def getStringValue(num): | |
d = { 0 : 'zero', 1 : 'one', 2 : 'two', 3 : 'three', 4 : 'four', 5 : 'five', | |
6 : 'six', 7 : 'seven', 8 : 'eight', 9 : 'nine', 10 : 'ten', | |
11 : 'eleven', 12 : 'twelve', 13 : 'thirteen', 14 : 'fourteen', |
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
Prism.languages.javascript = Prism.languages.extend('clike', { | |
'class-name': [ | |
Prism.languages.clike['class-name'], | |
{ | |
pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, | |
lookbehind: true | |
} | |
], | |
'keyword': [ | |
{ |
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
s1 = input() | |
s2 = input() | |
def checkPalindrome(s): | |
return s == s[::-1] | |
def isSubString(src, s): | |
for i in range(len(src)): | |
for j in range(len(src)): | |
if src[i:j] == s: |
NewerOlder