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
from fractions import Fraction | |
# Replace trials by probabilties of occurrences | |
def replace_probability(m): | |
for row in range(len(m)): | |
total = 0 | |
for item in range(len(m[row])): | |
total += m[row][item] | |
if total != 0: | |
for item in range(len(m[row])): |
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
from fractions import * | |
from decimal import * | |
from collections import * | |
import time | |
input=[[4, 17, 50], | |
[4, 30, 50], | |
[4,36,67], | |
[4,36,67,69], | |
[4,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,54], | |
[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], |
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 time | |
from fractions import * | |
from decimal import * | |
from collections import * | |
input=[[4, 17, 50], | |
[4, 30, 50], | |
[4,36,67], | |
[4,36,67,69], | |
[4,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,54], | |
[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], |
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 time | |
from fractions import * | |
from decimal import * | |
from collections import * | |
input=[[4, 17, 50], | |
[4, 30, 50], | |
[4,36,67], | |
[4,36,67,69], | |
[4,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,54], | |
[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], |
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 math | |
class BST: | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None | |
def insert(self, value): |
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 math | |
class BSTNode: | |
''' | |
''' | |
def __init__(self, data, left=None, right=None, parent=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
package com.company; | |
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
// write your code here | |
int [] arr= {10,5,2,3,5,4,3,7,8,9,1,0}; | |
int [] arrayer={5, 1, 22, 25, 6, -1, 8, 10}; |
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
nums = [1,2,3,4] | |
#Output: [1,3,6,10] | |
def runningSum(self, nums) : | |
array = [0] | |
for i in nums: | |
array.append(i + array[-1]) | |
print(array) | |
array.remove(0) |
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
from tkinter import * | |
import pandas as pd | |
import csv | |
from random import * | |
from tkinter.messagebox import * | |
CARD_BACK_BACKGROUND_COLOR="#96C1AA" | |
BACKGROUND_COLOR = "#B1DDC6" | |
learning_language="French" | |
language_already_learned="English" | |
try: |
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 random | |
from random import * | |
from tkinter import * | |
from tkinter.messagebox import * | |
from string import * | |
from json import * | |
import pyperclip | |
from tkinter.simpledialog import * |
NewerOlder