Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created November 14, 2019 21:56
Show Gist options
  • Save fakedrake/9b96388ec9e2433b626e2384977f2f73 to your computer and use it in GitHub Desktop.
Save fakedrake/9b96388ec9e2433b626e2384977f2f73 to your computer and use it in GitHub Desktop.
s1870697 Use the standard library function for sorting in-memory stuff. Use enumerate() to assign indexes to a list's elements. Use list comprehensions instead of for loops where possible to make your code more readable.
s1830962 Good
s1831707 No solution
s1833978 r is a table of indexes (ie naturals) so initialize it with -1 as 0 is a valid value.
s1836526 Good
s1837246 Good, use the standard library sort
s1837803 Good
s1839518 No solution
s1840235 j is not a hash of the lengths. You should search for one that works.
s1840770 No solution
s1846854 No solution
s1847802 Good
s1848178 Good
s1848273 No real solution
s1850160 r is a table of indexes (ie naturals) so initialize it with -1 as 0 is a valid value. Also you didn't check if the hashes of a bucket collide with each other
s1851202 Good. Use the standard library sort. Also R is a table of indexes (ie naturals) so initialize it with -1 as 0 is a valid value.
s1852056 No solution
s1857644 Good
s1862671 No solution
s1863702 Good
s1863753 R is a table of indexes (ie naturals) so initialize it with -1 as 0 is a valid value.
s1864650 Good but avoid global variables so hashCompress can be re-run from scratch.
s1865783 Good
s1865890 Use more descriptive variable names
s1869527 Good
s1870157 r is a table of indexes (ie naturals) so initialize it with -1 as 0 is a valid value.
s1870794 Good, use any() instead of sum() == 0
s1902147 Good
s2001696 No solution
s1835399 Good
s1869635 You are skipping the mini hash that corresponds to j == 0
s1836369 No solution
s1857043 Good
s1900925 Good
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment