- 30
- 728 911
CS50 Guide by Anvea
Приєднався 20 чер 2021
Hello. My name is Anvea and I love to share tutorial videos on whatever I'm working on at the moment.
[2023] CS50 - (Week 8) Trivia Solution | Walkthrough & Guide for Beginners | By Anvea
(This solution has been checked and verified for 2023.)
This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML.
In this video, I will walk you through the solution for Week 8 - Trivia.
DISCLAIMER
I've just started learning too so I am by no means an expert. However, I feel that as a beginner who have just learnt and understood the concepts, perhaps I could share with you the thought process and steps that worked for me too!
SOLUTIONS FOR CS50 PSETS
View the full playlist of solutions that I've made here: ua-cam.com/play/PLV6WiibkGOUvGq_EiBVNjcvHAluBb9wgu.html
LIKE AND SUBSCRIBE
If you found this video helpful, do give a like and subscribe to be notified when I post more videos for subsequent problem sets.
If you'd like to buy me a coffee, click here: www.buymeacoffee.com/anvea
:-)
ENROL NOW
To take the course: www.edx.org/course/introduction-computer-science-harvardx-cs50x
This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML.
In this video, I will walk you through the solution for Week 8 - Trivia.
DISCLAIMER
I've just started learning too so I am by no means an expert. However, I feel that as a beginner who have just learnt and understood the concepts, perhaps I could share with you the thought process and steps that worked for me too!
SOLUTIONS FOR CS50 PSETS
View the full playlist of solutions that I've made here: ua-cam.com/play/PLV6WiibkGOUvGq_EiBVNjcvHAluBb9wgu.html
LIKE AND SUBSCRIBE
If you found this video helpful, do give a like and subscribe to be notified when I post more videos for subsequent problem sets.
If you'd like to buy me a coffee, click here: www.buymeacoffee.com/anvea
:-)
ENROL NOW
To take the course: www.edx.org/course/introduction-computer-science-harvardx-cs50x
Переглядів: 13 207
Відео
[2023] CS50 - (Week 2) Bulbs Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 19 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 2 - Bulbs. DISCLAIMER I've just started learning too so I am by no means an expert. Howev...
[2023] CS50 - (Week 7) Fiftyville Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 27 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 7 - Fiftyville. DISCLAIMER I've just started learning too so I am by no means an expert. ...
[2023] CS50 - (Week 7) Movies Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 23 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 7 - Movies. DISCLAIMER I've just started learning too so I am by no means an expert. Howe...
[2023] CS50 - (Week 7) Songs Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 14 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 7 - Songs. DISCLAIMER I've just started learning too so I am by no means an expert. Howev...
[2023] CS50 - (Week 6) DNA Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 32 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 6 - DNA. TIMESTAMPS 00:00 - Introduction 03:00 - Understanding the distribution code 05:1...
[2023] CS50 - (Week 6) Readability (Python) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 11 тис.2 роки тому
(This solution has been checked and verified for 2023.) (Solution and walkthrough for Week 2 - Readability: ua-cam.com/video/rOLYDNjey34/v-deo.html) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for W...
[2023] CS50 - (Week 6) Credit (Python) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 7 тис.2 роки тому
(This solution has been checked and verified for 2023.) (Solution and walkthrough for Week 1 - Credit: ua-cam.com/video/dMRuPeyk7Fo/v-deo.html) Luhn's Algorithm in Python: allwin-raju-12.medium.com/credit-card-number-validation-using-luhns-algorithm-in-python-c0ed2fac6234 This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you w...
[2023] CS50 - (Week 6) Cash (Python) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 12 тис.2 роки тому
(This solution has been checked and verified for 2023.) (Solution and walkthrough for Week 1 - Cash: ua-cam.com/video/DvXLpwi7Les/v-deo.html) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 6 -...
[2023] CS50 - (Week 6) Mario More (Python) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 4,4 тис.2 роки тому
(This solution has been checked and verified for 2023.) (Solution and walkthrough for Week 1 - Mario (More): ua-cam.com/video/IYiREa_Oo84/v-deo.html) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for ...
[2023] CS50 - (Week 6) Mario Less (Python) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 13 тис.2 роки тому
(This solution has been checked and verified for 2023.) (Solution and walkthrough for Week 1 - Mario (Less): ua-cam.com/video/aGLTy7Rjgho/v-deo.html&t) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution fo...
[2023] CS50 - (Week 6) Hello Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 5 тис.2 роки тому
(This solution has been checked and verified for 2023.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 6 - Hello. DISCLAIMER I've just started learning too so I am by no means an expert. Howev...
[2022] CS50 - (Week 6) World Cup Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 17 тис.2 роки тому
(This solution has been checked and verified for 2022.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 6 - World Cup. TIMESTAMPS 00:00 - Introduction 00:35 - Implementation Details 01:23 - Und...
[2023] CS50 - (Week 5) Speller Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 55 тис.2 роки тому
(This solution has been checked and verified for 2023. Please refer to the pinned comment for a correction to the last function - // Unloads dictionary from memory, returning true if successful, else false) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML....
[2022] CS50 - (Week 5) Inheritance Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 21 тис.2 роки тому
(This solution has been checked and verified for 2022.) This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML. In this video, I will walk you through the solution for Week 5 - Inheritance. TIMESTAMPS 00:00 - Introduction 00:46 - Understanding the Given Informat...
[2023] CS50 - (Week 4) Recover Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 49 тис.2 роки тому
[2023] CS50 - (Week 4) Recover Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 4) Filter (More) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 17 тис.2 роки тому
[2023] CS50 - (Week 4) Filter (More) Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 4) Filter (Less) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 68 тис.3 роки тому
[2023] CS50 - (Week 4) Filter (Less) Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 1) Cash Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 26 тис.3 роки тому
[2023] CS50 - (Week 1) Cash Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 3) Runoff Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 53 тис.3 роки тому
[2023] CS50 - (Week 3) Runoff Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 3) Plurality Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 22 тис.3 роки тому
[2023] CS50 - (Week 3) Plurality Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 2) Substitution (More) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 25 тис.3 роки тому
[2023] CS50 - (Week 2) Substitution (More) Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 2) Caesar (Less Comfortable) | Walkthrough & Guide for Beginners | By Anvea
Переглядів 33 тис.3 роки тому
[2023] CS50 - (Week 2) Caesar (Less Comfortable) | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 2) Readability Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 28 тис.3 роки тому
[2023] CS50 - (Week 2) Readability Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 2) Scrabble Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 20 тис.3 роки тому
[2023] CS50 - (Week 2) Scrabble Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 1) Credit Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 57 тис.3 роки тому
[2023] CS50 - (Week 1) Credit Solution | Walkthrough & Guide for Beginners | By Anvea
CS50 - (Week 1) Cash (Less Comfortable) Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 6 тис.3 роки тому
CS50 - (Week 1) Cash (Less Comfortable) Solution | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 1) Mario (More Comfortable) | Walkthrough & Guide for Beginners | By Anvea
Переглядів 13 тис.3 роки тому
[2023] CS50 - (Week 1) Mario (More Comfortable) | Walkthrough & Guide for Beginners | By Anvea
[2023] CS50 - (Week 1) Mario (Less Comfortable) | Walkthrough & Guide for Beginners | By Anvea
Переглядів 30 тис.3 роки тому
[2023] CS50 - (Week 1) Mario (Less Comfortable) | Walkthrough & Guide for Beginners | By Anvea
CS50 - (Week 1) Population Growth Solution | Walkthrough & Guide for Beginners | By Anvea
Переглядів 8 тис.3 роки тому
CS50 - (Week 1) Population Growth Solution | Walkthrough & Guide for Beginners | By Anvea
im crying on blur now
Thank you for sharing your solution to cs50's substitution. It's two lines shorter than mine but I went modular instead of purely functional. I found your cipher method odd. It includes a lot of magic numbers that should be commented with explanation. I found it much easier to simply have a key for upper and a key for lower. Below is the code I wrote to cipher the text. It's a few lines longer but in my opinion a lot easier to understand or read. void cipher(string plainText, char upperKey[], char lowerKey[], char *cipherText) { int length2 = strlen(plainText), plainTextIndex = 0; for (int i = 0; i < length2; i++) { if (isupper(plainText[i])) { plainTextIndex = plainText[i] - 'A'; cipherText[i] = upperKey[plainTextIndex]; } else if (islower(plainText[i])) { plainTextIndex = plainText[i] - 'a'; cipherText[i] = lowerKey[plainTextIndex]; } else { cipherText[i] = plainText[i]; } } cipherText[length2] = '\0'; }
I'm watching this after I produced my solution to substitution. I admit I'm kinda dumb, I'm genuinely confused at how your duplicate check works. It does compare each key value to the next, but how does that compare it against all cases? Is the structure such that it is nested loops comparing each key value to all the rest of the key values or is it just checking the next value? What if the duplicate isn't the same as the char it is next to? What happens if it is used twice but in separate places in the key? I understand that it compares each char to the next, but how does that compare it to all other key values?
i really love your teachings and the way your do the presentation of your own version, and do you think that this cs50 course is doable for beginners without any external help like your videos ? i found it seriously complicated and couple of levels higher than what they teach in the lectures and instructions. i would like the hear your own opinion
Hi, I have reached this part and have been stuck on it for a while. I keep getting the following error - Runtime error near line **: FOREIGN KEY constraint failed (19) I can't figure out what the issue is that's causing this. Can anyone help? UPDATE flights SET origin_airport_id = airports.city FROM airports WHERE flights.origin_airport_id = airports.id; UPDATE flights SET destination_airport_id = airports.city FROM airports WHERE flights.destination_airport_id = airports.id; SELECT id, hour, minute, origin_airport_id, destination_airport_id FROM flights WHERE year = 2023 AND month = 7 AND day = 29 ORDER BY hour ASC LIMIT 1;
Thank you so much
Do you have Instagram? I think im in love with you.
how do i upload all the sql Files to CS50. When i add SQL1 it it says its missing SQL2, 3 ,4 , 5 ETC...
we can't use count++ anymore?
Thank you very much.
Tysm
where are you from? u got a lovely accent ps: i could not hear the frog being loud xD
i didn't get nothing from blur i don't know what happened
Finally found the right nesting formula compared to c
make sure yall change int words = 1 and not 0 ;)
This code resulted in segmentation fault. Pretty sure I'm not the only one
Nice thanks
Thank You very much
I tried running this code and kept getting "use of an unidentified integer "i" on line 18. Anyone know why?
This makes me realize how badly optimized my code was XD. Thanks a lot miss.
When I watch these videos, I feel like I'm cheating, But it gets to a point where its the only thing I can do. The lectures and shorts touch on 20% of the topic, and the problem sets dive deeper and expect us to know the other 80%. Some people will say its the best way to learn, but no. there's a point in where the difficulty gives diminishing returns.
Thank you, very helpful.
why is my 9.sql wrong please help me SELECT DISTINCT name FROM people WHERE id IN (SELECT person_id FROM stars WHERE movie_id IN (SELECT id FROM movies WHERE year = 2004)) ORDER BY birth ASC; it prints 19261 values instead of 19325 values
SELECT name FROM people JOIN stars on people.id = stars.person_id JOIN movies on stars.movie_id = movies.id WHERE movies.year = '2004' ORDER BY people.birth;
@@mondasoliman4171 Can you please show me why my query is wrong?
no DISTINCT name just name
OMFG! Thanks a lot for the solution. This is only solution that made sense to me.
Why cursing bro :/
I don't understand your is_tie function. Persay there were 5 candidates and 90 voters. If 2 were eliminated and the remaining 3 has 30 votes each. eliminate = 2 and counter = 3. With your code, that wouldn't be a tie, but they all have the same amount of votes, so that should be a tie I think the easiest way to do it, is to just check if any candidate has more than the min amount of votes.
does anyone understand why the remianing number of participants should be the same as the mincount?
I tried three different approaches for solving this from cs50 import get_float def main(): while True: try: cents = get_float("Cents: ") if (cents >= 0): break except ValueError: print("Enter a valid number!") cents = round(cents * 100) FirstMethod(cents) SecondMethod(cents) ThirdMethod(cents) # This was the first attempt def FirstMethod(cents): quarter = cents // 25 cents = cents % 25 dimes = cents // 10 cents = cents % 10 nickels = cents // 5 cents = cents % 5 pennies = cents coins = quarter + dimes + nickels + pennies print(f"Coins: {int(coins)}") # Second method def SecondMethod(cents): coins = [25, 10, 5, 1] value = 0 for coin in coins: while cents >= coin: cents -= coin value+= 1 print(f"Coins: {int(value)}") # Third method def ThirdMethod(cents): count = 0 while cents >= 25: cents-= 25 count+= 1 while cents >= 5: cents-= 5 count+= 1 while cents >= 10: cents-= 10 count+= 1 print(f"Coins: {int(count)}") main()
at 15:25, instead of manually subtracting 32 to convert to uppercase, I just used the toupper function. So it goes like this: if (islower(key[i])) { key[i] = toupper(key[i]); }
could you speak more clearly
Tysm, I was litteraly struggling for this. Thank god you told me about %100
I was staying up past 2 wondering why I kept getting an exit code 2 error when the code matched up but I realized I forgot stdlib for malloc😭
With a different approach def main(): height = get_height() if height is not None: print_mario(height) else: print("Too many invalid attempts, exiting...") def get_height(): attempts = 0 max_attempt = 5 while attempts < max_attempt: try: height = int(input("Height: ")) if height > 0 and height <= 8: return height else: print("Enter a valid number!") except ValueError: print("Enter a number!") attempts += 1 return None def print_mario(height): for i in range(1, height + 1): for k in range(height - i): print(" ", end='') for j in range(i): print("#", end='') print() main()
Your solution seems more efficient than mine. I never joined tables because I decided to break everything into chunks. With 125 lines of investigation, I ended up with Taylor-James and Bruce-Robin. Bruce and Taylor are both taking the same flight, flight_id 36. So, I decided to investigate who they talked with at a specific time, July 28th, and the duration was less than 60 secs. I managed to find the call receivers, James (Taylor's) and Robin (Bruce's). I even tried to get their passport_numbers from people's tables. But unfortunately Robin's passport_number was NULL in the output. I couldn't compare it in the passenger's table where I need flight_id (36), which I have, and passport_number, which was missing in the database (I guess). So, it made me suspicious, so I referred to your video. But thankfully, you also ended up with one of my answer choices (Bruce - Robin). Even if my solution was inefficient, I learned a lot as it is my first time learning SQL. I am happy that after hours of investigation; at least I didn't end up with the wrong pair of criminals. You made my day. Overall, Thank you for your support in this course)))
I’m so happy that I’m not the only one who found this challenging. I felt like crying myself to sleep
Welcome to the party.
Why she create a Data type BYTE at the top? When she didnt use it below? Can someone pointed out from me? Thanks
l made mine in 45 lines haha, but great work thanks for helping everyone!!
for cents = cents - 25 another way of writing it is cents -= 25, cents -=10 etc..., for me this is easier to understand because we're keeping it consistent
I thought I was the only newbie here but I guess I am not anyway thanks much for your videos it's been beneficial your approach to things is very much on point thanks a lot
#include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> int main(int argc, string argv[]) { if (argc != 2) { printf("Usage: ./substitution key "); return 1; } else { if (strlen(argv[1]) != 26) { printf("Key must contain 26 characters "); return 1; } else { int n = strlen(argv[1]); string key = argv[1]; // In C, you need to declare arrays with a specific size and allocate memory for them // before using them. char key_upper[26]; char key_lower[26]; for (int i = 0; i < n; i++) { if (argv[1][i] < 65 || argv[1][i] > 122 || (argv[1][i] > 90 && argv[1][i] < 97)) { printf("Key must contain only alphabets "); return 1; break; } for (int k = 0; k < n; k++) { key_upper[k] = toupper(key[k]); key_lower[k] = tolower(key[k]); } for (int x = i - 1; x >= 0; x--) { if (key_upper[i] == key_upper[x]) { printf("Key must not contain any duplicate characters "); return 1; } } } string text = get_string("Plaintext: "); string text1 = text; for (int j = 0, m = strlen(text1); j < m; j++) { if (text1[j] > 64 && text1[j] < 91) { text1[j] = key_upper[text1[j] - 65]; } else if (text1[j] > 96 && text1[j] < 123) { text1[j] = key_lower[text1[j] - 97]; } } printf("ciphertext: %s ", text1); } } }
Me personally I'll take my chances with academic honesty and copy all the solutions to get the CS50 certificate. Afterwards I'll learn one language at a time, for example do C and Python for a year using UA-cam, Udemy, Coursera etc
huh the value of my "match" stays at 1 even though I checked through everything and it is clearly in a loop. R.I.P, intro to Python they said edit: I messed up the indentation, yikes
Introducing of python he said.
i LIKE MENS
thank you
Hey! First of all, your videos have been such a huge help!! Only found a small error at 3:16 where the letter should be L instead of R. As the letter is the 12th letter of the alphabet as opposed to 12 spaces away from F 😊
I solved this quite differently while googling how to print spaces xD (therefore you might struggle to understand the print line, I have no idea how it works but whatever ;DD) Everyone does it differently, that's the flexibility of Python :)) import cs50 while True: height = cs50.get_int("Height: ") if height in range(1, 9): break y = height - 1 z = 1 for i in range(height): print(""+" "*y+"#" * z) y -= 1 z += 1
thank you!
thank you for the efforts But i think it can't be the right solution: you have admitted that the user will enter a 16-digit number, so you did the modulo for each number. but how we did if the user gives us a 4 or a random-digit number? the luhn's algo won't be used ! need an explication if isaid false thingss thank youu
i got segmentation fault error message can u explain me why is that and how to fix is sir?
This was very helpful, thank you :)