-
Continue reading →: Some HackerRank Solutions
Balanced Brackets https://www.hackerrank.com/challenges/balanced-brackets/problem Queue using Two Stacks https://www.hackerrank.com/challenges/queue-using-two-stacks/problem Merge two sorted linked lists https://www.hackerrank.com/challenges/merge-two-sorted-linked-lists/problem
-
Continue reading →: HackerRank Solutions: Jesse and Cookies
Problem Jesse loves cookies and wants the sweetness of some cookies to be greater than value . To do this, two cookies with the least sweetness are repeatedly mixed. This creates a special combined cookie with: sweetness Least sweet cookie 2nd least sweet cookie). This occurs until all the cookies have a sweetness .…
-
Continue reading →: HackerRank Solutions: No Prefix Set
Problem There is a given list of strings where each string contains only lowercase letters from , inclusive. The set of strings is said to be a GOOD SET if no string is a prefix of another string. In this case, print GOOD SET. Otherwise, print BAD SET on the first line followed by the string…
-
Continue reading →: HackerRank Solutions: Tree: Huffman Decoding
Problem Huffman coding assigns variable length codewords to fixed length input characters based on their frequencies. More frequent characters are assigned shorter codewords and less frequent characters are assigned longer codewords. All edges along the path to a character contain a code digit. If they are on the left side of…
-
Continue reading →: HackerRank Solutions: Tree: Preorder Traversal
Problem Complete the function in the editor below, which has parameter: a pointer to the root of a binary tree. It must print the values in the tree’s preorder traversal as a single line of space-separated values. Input Format Our test code passes the root node of a binary tree to the preOrder function.…
-
Continue reading →: Debugging in Python
There are three main tools for debugging in Python. In Python version less than 3, it was common to use the set_trace() command for making a starting debugger point, but in newer versions, it is possible to define the PYTHONBREAKPOINT environment variable before running the Python program and the debugger…
-
Continue reading →: Ray.Tune Model Optimization
One of the very important questions in the deep learning is what model is the best. There are two well-known methods to find the best models: Reinforcement Learning Methods Search Methods There are some good resources for RL methods, such as: 2018 – Learning Transferable Architectures for Scalable Image Recognition…
-
Continue reading →: PyTorch Code Profiling
There are some tools for profiling the PyTorch codes. PyTorch Profiler This can generate almost all is happening in PyTorch codes, such as CPU, GPU, memory, and stack usage. Moreover, it can generate enough information to be used in TensorBoard or even simple json format which can be opened in…
-
Continue reading →: Interactive Plots in JupyterLab
There are several ways to plot interactively in JupyterLab. Altair Plotly Bokeh ipywidgets Between all the above, I found ipywidgets easier to use than the others. To be able to use ipywidgets, some installations are needed: If we work in user mode in Linux, then clone the actual environment with:…
-
Continue reading →: Emacs and Google Drive
Using Emacs to edit Google Drive Documents Tramp in Emacs let us have access to Google Drive. It is usually useful when we want to import some codes into our JupyterLab notebooks in the Google Colab. Here we briefly describe how to do so in Linux. This method needs Emacs…