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
""" | |
a) The sum of two vectors is just the element-wise sum of their elements. | |
For example, the sum of [1, 2, 3] and [4, 5, 6] is [5, 7, 9]. Write a function | |
called sparse_add that takes two sparse vectors stored as dictionaries | |
and returns a new dictionary representing their sum. | |
c) It would be useful to automatically “sparsify” a vector. Write a function that called | |
sparsify that takes in a list of integers and returns a dictionary representing a | |
sparse vector. |
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 java.util.*; | |
public class FDM_codingChallenge { | |
void archie() { | |
int[][] archie_choords = new int[4][2]; | |
boolean found = false; | |
char[][] test_basement = { | |
{'1', '1', '1', '1', '1', '1', '1', '1', '1', '1'}, | |
{'1', '0', '0', '0', '0', '0', '0', '0', '0', '1'}, | |
{'1', '0', '0', 'A', '0', '0', '0', '0', '0', '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 java.util.*; | |
public class Assignment1Q5b { | |
public static void main(String[] args) { | |
double k, a = 1, b = 1, n = 1, err; | |
Scanner in = new Scanner(System.in); | |
do { | |
try { | |
System.out.print("Enter the lower bound of the integral: "); |
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
# hell | |
def boxy_boi(box_score): | |
winScore = 0 | |
winTeam = "" | |
for i in range(0, 2): | |
team = box_score[i] | |
#print("team: ", team) | |
score = team[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
//April 15, 2020 | |
//link: https://www.hackerrank.com/challenges/java-date-and-time/problem | |
import java.io.*; | |
import java.math.*; | |
import java.security.*; | |
import java.text.*; | |
import java.util.*; | |
import java.util.concurrent.*; | |
import java.util.function.*; |
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
# Question 1 | |
def opposite_day(stringy_boi): | |
''' (str) -> (str)''' | |
stringy_boi2 = "" | |
for c in stringy_boi: | |
if c in "qwertyuiopasdfghjklzxcvbnm": | |
c = c.upper() | |
stringy_boi2 += c | |
elif c in "QWERTYUIOPASDFGHJKLZXCVBNM": |
NewerOlder