-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new question about List Ordering Mayhems #11
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# List Ordering Mayhem | ||
|
||
## Question | ||
|
||
Welcome to **List Ordering Mayham**! Here is the problem statement: | ||
|
||
> You are given an unordered list of the knights of players playing a chess game, each have their own x and y axes of the position they are on the board. Your task is to write a function that returns the correct descending order of y/number value in the list of the knights on the chessboard. | ||
|
||
|
||
## Inputs/Outputs | ||
Example Input: | ||
```python | ||
list = [[F,5], [G,2], [C,9], [A,7], [E,1]] | ||
``` | ||
|
||
Expected Output: | ||
```python | ||
list = [[E,1], [G,2], [F,5], [A,7], [C,9]] | ||
``` | ||
|
||
|
||
## Marking Criteria: | ||
- Achieve an efficient solution | ||
- Achieve an elegant / easy to read solution | ||
- Document your code ensuring good readability | ||
- Use good code design patterns and practicies within your code | ||
- Use good naming conventions throught your code | ||
- Attempt to get a relativly low time complexetiy if possible / O(log(n)) or O(n) is preferable | ||
|
||
|
||
## Example Code | ||
|
||
```python | ||
function generateOrderedList(list l): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM. But, as others have suggested, maybe you could've added a sample solution |
||
>>> | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good! Could also be an interesting question when it comes to learning about objects/classes (e.g ordering the y-val then outputting the ordered x-vals or something like that) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool question! Maybe provide some more sample code to make the solution more doable for beginners