Tuples

Received an email from HackerRank to solve a Tuples challenge:  https://www.hackerrank.com/challenges/python-tuples?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign

If interested take a look at the requirements.

After reading the requirements, using the Spyder 3.1.0 IDE I came up with a solution which did not have a need for the first line from the Sample Input. The Sample input follows: Continue reading “Tuples”

Remove Duplicates from Sorted List II

This challenge comes courtesy of LeetCode:  https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/

The challenge is rated medium difficulty. At this time there have been 96,122 accepted solutions from 334,885 submissions. If you decide to tackle the challenge make sure you read it a few times.

On my first pass (which I did not submit) I missed the word ‘distinct’ from the requirements ;o(

On purpose, my solution completely ignores the fact that the list is ‘sorted. If this would have been work or a contest I would have taken such requirement into consideration :o)
Continue reading “Remove Duplicates from Sorted List II”

Word Pattern

It seems to me that LeetCode (https://leetcode.com/) has more complex challenges than HackerRank (https://www.hackerrank.com/domains?h_r=logo). Their approach to testing the solutions is different. They not only test for correctness but they also check for execution time.

In the next few weeks will concentrate in solving challenges from LeetCode. I will also try to get to weekend competitions if they are relatively early in the day (I am a morning person).

If interested take a look at the requirements for this challenge using the following link:  https://leetcode.com/problems/word-pattern/ Continue reading “Word Pattern”

Last Python Intro Challenges

Seems like in the past couple weeks I have been getting up earlier than usual. I decided to complete the remaining introduction Python challenges at HackerRank. If you are interested please take a look at the following URL:  https://www.hackerrank.com/domains/python/py-introduction

For these challenges I decided to use Spyder 3 IDE. I am using:  Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] Continue reading “Last Python Intro Challenges”

Integers Come in All Sizes

I received an email message with a HackerRank challenge. If interested the simple challenge is located at the following URL:  https://www.hackerrank.com/challenges/python-integers-come-in-all-sizes?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign

The challenge is quite simple when using Python. Since Python 3 the distinction between integers, long integers and unlimited size integers is gone. In Python 3 an integer could probably take all the virtual memory in your machine ;o). Continue reading “Integers Come in All Sizes”

Python Divmod and Mod Power

I received via email a couple messages with two easy Python challenges named “Mod Divmod” and “Power – Mod Power”. Following are links to the challenges:

https://www.hackerrank.com/challenges/python-mod-divmod?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign

https://www.hackerrank.com/challenges/python-power-mod-power?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign Continue reading “Python Divmod and Mod Power”

Calculator in Python

As I have mentioned on different occasions, I like to read technical topics in order to review and learn new things. This weekend I decided to spend some time with Tkinter.

For starters Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. Continue reading “Calculator in Python”

Decision Tree – Machine Learning

In machine learning, a decision tree is a predictive model which maps observations about an item (represented in the branches) to conclusions about the item’s target value (represented in the leaves). It is one of the predictive modeling approaches used in statistics, data mining and machine learning.

Tree models where the target variable can take a finite set of values are called classification trees; in these tree structures, leaves represent class labels and branches represent conjunctions of features that lead to those class labels. Continue reading “Decision Tree – Machine Learning”