This is a repository that contains submissions for the HyperionDev Code Reviewer test assessment.
I chose Option 1: Python Task
Thank you for your code submission, on trying to run your code locally, here are my observations;
- You have indentation incosistency on lines: 3, 4, 5, 6, 7 and 8, it would help if you used an IDE that recognises a python file, that way it will authomatically indent your code.
- On line 5:
x = "".join(sorted())
, thesorted()
takes in a parameter, possibly your string valuei
- The Output required your array of strings to start with the list with the least number of anagrams, i.e
[['bat'], ['tan', 'nat'], ['eat', 'tea', 'ate']]
. However, your most possible out would have been:[['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]
, a final sort on the list would fix this.
- You have a good understanding of the python syntax, you know how to use classes, however, for this assignment a method would help you acheive the same result. Below is my submission;
def groupAnagrams(strs):
# declare a dictionary that holds your list of anagrams
result = {}
for item in strs:
# Check if item already exists in list
x = "".join(sorted(item))
if x in result:
result[x].append(item)
else:
result[x] = [item]
# Sort your final list of anagrams as per output
final_result = [item[::-1] for item in result.values()]
return final_result[::-1]
print(groupAnagrams(["eat", "tea", "tan", "ate", "nat", "bat"]))
Output: [['bat'], ['nat', 'tan'], ['ate', 'tea', 'eat']]
- Indentation: Please choose a particular indentation style to use throughout, if tabs, use tabs all the way, if spaces use spaces all the way and mind how many spaces too.
- The code lacked comments, comments help guide others on what is happening on a specific line of code.
The documentation of this assignment was okay, it does guide the candidate for the assignment on what should be done, however, here are some pointers;
- It would have been better to start with describing what an Anagram is
- Given the input example and output, there seems to have been on more instruction missing on the assignment, for the candidate submitting code to organize the array of anagrams from the array with the least number of anagrams to the largest.
Section B: Repository Link | Live App Link
I chose Option 1: Say the Number
- Clone this repository:
git clone [email protected]:ZackAtama/HyperionDev-THT.git
- Install dependencies:
npm install
oryarn add
- Running tests:
npm test
- Run application:
npm run dev
- In your terminal, soon as the application starts running, you'll be presented with a prompt in your ternimal to enter any number;
Enter any number:
- Enter any number and press enter on your keyboard
- The application will print out your number in words and exit.