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
def lines(file1, file2): | |
result = set() | |
def getLinesList(file): | |
# storage array | |
fileList = [] | |
# temp storage array | |
tempList = [] | |
# if all lines have \n at the end |
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 cs50 | |
# Pseudo | |
# - divide total by a coin amount | |
# - keep dividing it by increments of that coin, count each time | |
# - subtract from total each time, amount left undivided | |
# - move the amount left from coin to coin | |
def greedy(): |
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
// Implements a dictionary's functionality | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <xlocale.h> |
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
// Implements a dictionary's functionality | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include "dictionary.h" |
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
I mean redo the code entirely | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "bmp.h" | |
int main(int argc, char *argv[]) | |
{ | |
// ensure proper usage |
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
// Copies a BMP file | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "bmp.h" | |
int main(int argc, char *argv[]) | |
{ | |
// ensure proper usage |
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
// Helper functions for music | |
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <math.h> | |
#include "helpers.h" |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
// cleaned up with counter | |
int main(int argc, char *argv[]){ | |
if(argc != 2) { | |
printf("Error on input"); | |
exit(1); | |
} | |
string input = get_string("Input:"); | |
printf("plaintext: %s\n", input); | |
printf("ciphertext: "); |
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
There is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate the total time required for all the customers to check out! | |
The function has two input variables: | |
customers: an array (list in python) of positive integers representing the queue. Each integer represents a customer, and its value is the amount of time they require to check out. | |
n: a positive integer, the number of checkout tills. | |
The function should return an integer, the total time required. | |
EDIT: A lot of people have been confused in the comments. To try to prevent any more confusion: |