codingbat → leetcode


Happily, several students are telling me that they have reached the end of all the codingbat problems! Yay, I consider this an awesome accomplishment! It’s kind of like finishing all of Netflix, but better.

Can you still practice your Python for XP after you’ve reached this point? Yes! For students that finish all of the codingbat.com practice problems but still wish to earn an additional +2XP each week, level up to leetcode. Create a FREE account by clicking ‘Register’ at the top right corner of the page (Note: There are paid subscriptions available on this website, but these won’t be needed to complete the problems). You will need to verify your email which will be a bit annoying, but it will eventually trust that it is you and you will be able to proceed.

After creating an account, you should be able to complete practice problems. Scroll down the page until you see a long list of problems each with a number and a title. These are the problems available on this website. When you select a problem for the first time, you may be prompted with a window asking if you would like to work in the ‘ToolBar’ or ‘Code Editor’ window format. To get started with the website, you should choose ‘ToolBar’ as you can change this later and it makes things simpler for now.

First, set the website’s language to the correct version of “Python.” After clicking on a problem, there should be a language drop down option at the top left of the ‘Code’ window on the right half of your screen. Click on this drop down and select ‘Python3‘ from the available languages. (Note that another language option is ‘Python’ (meaning the older ‘Python 2.0’) but do not choose this option!) The website should store some type of cookie allowing you to stay in ‘Python3’ across all the problems after you change it this one time, but if not you can just refer back to these steps.

This website handles code submissions differently than codingbat.com as ‘running’ your code does not ‘grade’ your code as was the case on codingbat.com. If you select to ‘Run’ your code at the top of the screen, your code will run on the test cases that were given on the description page. Passing these test cases does not mean that you have solved the problem as there are still several hidden test cases that the website will test your code on. To check if you have found a solution to the given problem, click the green cloud button that says ‘Submit’. This will give you an evaluation on whether your code has passed or failed the task of the given problem. You will be able to resubmit another solution if your initial solution did not pass.

PLEASE NOTE: The difficulty of these practice problems can vary from easy to extremely difficult and they encompass a much vaster range of difficulty than the codingbat.com website provided. Feel free to filter the results based on the difficulty to find problems that fit with your Python skill level. You do not have to complete the problems in order. I would urge you so stay away from problems that talk about ‘time complexity’ if you are unsure of what that is (For those curious, this topic is taught in CPSC 340.)

To claim these leetcode +2XP (in place of codingbat.com +2XP), spend 30 minutes working on problems, in Python, on this website and send me an email on Friday of the given week with subject line “CPSC/DATA 350 leetcode XP”. In the body of the email, you should type “I spent 30 minutes this week working problems, in Python, on leetcode.com,” followed by the Honor Pledge and your full name as a signature.

(Thanks to Sully for scoping this out and writing most of the above instructions.)

Happy coding!