Skip to content

Elso hazi #14

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Elso hazi #14

wants to merge 2 commits into from

Conversation

BenceMatrai
Copy link

No description provided.

if tup[-1] == ending:
res.append(tup)
return res

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow :) Klassz megoldas, bar egy kicsit lassu. https://wiki.python.org/moin/HowTo/Sorting
key functions alatt talasz elegansabb megoldast.

basic/list2.py Outdated
@@ -13,17 +13,15 @@
# so [1, 2, 2, 3] returns [1, 2, 3]. You may create a new list or
# modify the passed in list.
def remove_adjacent(nums):
# +++your code here+++
return
return list(set(nums))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haat... nem egeszen. mit gondolsz jo eredmenyt kapnal mondjuk [1,2,3,3,1] listara?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja igen elnéztem, azt hittem csak simán halmazként kell visszaadni. Javítom majd:)

basic/list2.py Outdated


# E. Given two lists sorted in increasing order, create and return a merged
# list of all the elements in sorted order. You may modify the passed in lists.
# Ideally, the solution should work in "linear" time, making a single
# pass of both lists.
def linear_merge(list1, list2):
# +++your code here+++
return
return sorted(list1 + list2)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nem rossz probalkozas, de a python sorted TimSort algoritmussal dolgozik nlogn idoben. A feladat leirasaban a megoldas; a ket lista eleve rendezett. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants