Tags: %TAGME{ tpaction="" web="Main" tag="" }% view all tags

# LeetCode Exercise 1

###### Due September 1, 11:55pm

The goal of this course is to gain experience with developing and testing Algorithms in the LeetCode environment.

Two person teams will be assigned for this assignment. You should work together collaboratively, but should each turn in a solution to Moodle.

### Assignment

Attempt to solve 344, Counting Bits

• 40% for working solution
• +5% for solutions that have O(n) space complexity (include an analysis that justifies this)
• +5% for solutions that have O(n) runtime complexity (include an analysis that justifies this)
Attempt to solve 349. Intersection of Two Arrays
• 40% for working solution
• +5% for solution with O(nlogn) runtime complexity
• +10% for solution with O(n) runtime complexity
O(n) complexity will be covered in detail later, but for now consider that it means:
1. For space complexity it means that the amount of memory used is increases linearly with the size of n (number passed to the program).
2. For time complexity it (basically) means that (dominate) number of iterations used to compute a solution increases linearly with the size of n

### Turn in:

1. Source code for your solution
2. Samples runs showing the operation with input and outputs.
3. Explanations for your complexity analysis
Be prepared to discuss you solutions in class.

--    