Skip to content

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
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
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